Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generic-metrics): Don't produce headers unnecessarily #67396

Closed
wants to merge 3 commits into from

Conversation

lynnagara
Copy link
Member

These are no longer needed by snuba, it is unnecessary to produce this information as we don't use it for anything

These are no longer needed by snuba, it is unnecessary to produce
this information as we don't use it for anything
@lynnagara lynnagara requested a review from a team as a code owner March 20, 2024 22:48
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.33%. Comparing base (74ac372) to head (30f3943).
Report is 113 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #67396    +/-   ##
========================================
  Coverage   84.33%   84.33%            
========================================
  Files        5309     5317     +8     
  Lines      237239   237594   +355     
  Branches    41031    41104    +73     
========================================
+ Hits       200079   200379   +300     
- Misses      36942    36997    +55     
  Partials      218      218            
Files Coverage Δ
...c/sentry/sentry_metrics/consumers/indexer/batch.py 96.56% <ø> (-0.02%) ⬇️

... and 77 files with indirect coverage changes

@@ -501,12 +497,7 @@ def reconstruct_messages(
kafka_payload = KafkaPayload(
key=message.payload.key,
value=rapidjson.dumps(new_payload_value).encode(),
headers=[
*message.payload.headers,
("mapping_sources", mapping_header_content),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized, this is technically still used by the last seen updater, so I'm not sure we can safely delete these headers while that consumer is still around.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be fine, as I think we'll just hit this condition in the last seen updater https://github.com/getsentry/sentry/blob/master/src/sentry/sentry_metrics/consumers/last_seen_updater.py#L52-L65 and the message will be ignored/dropped.

Still, maybe let's make a note of this -- that by removing the headers the last seen updater will no longer be updating the last_seen column in PG.

@lynnagara lynnagara closed this Apr 4, 2024
@lynnagara lynnagara deleted the indexer-simplify-messages branch April 4, 2024 00:22
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants