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

ref(am1): Collect span counts for orgs prior to migrating #75485

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Aug 1, 2024

Summary

Some organizations are not yet on AM2, without span extraction running, which makes it hard to estimate usage for future plan changes to AM3. This allows us to collect metrics for only those specific customers who we can't estimate through outcomes.

Flag I'm using in lieu of a new option is from the subscription plan handler, should be similarly fast to an option in region mode.

Some organizations are not yet on AM2, and are unsampled without span extraction running, which makes it hard to estimate usage for future plan changes to AM3. This allows us to collect metrics for only those specific customers who we can't estimate through outcomes.
@k-fish k-fish requested a review from phacops August 1, 2024 20:34
@k-fish k-fish self-assigned this Aug 1, 2024
@k-fish k-fish requested a review from a team as a code owner August 1, 2024 20:34
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 1, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.19%. Comparing base (77c048a) to head (c8931f5).
Report is 43 commits behind head on master.

Files Patch % Lines
src/sentry/ingest/consumer/processors.py 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #75485    +/-   ##
========================================
  Coverage   78.18%   78.19%            
========================================
  Files        6809     6816     +7     
  Lines      302915   303037   +122     
  Branches    52132    52149    +17     
========================================
+ Hits       236844   236954   +110     
- Misses      59686    59690     +4     
- Partials     6385     6393     +8     
Files Coverage Δ
src/sentry/ingest/consumer/processors.py 83.87% <66.66%> (-1.17%) ⬇️

... and 46 files with indirect coverage changes

@@ -187,6 +187,8 @@ def process_event(
event_id=event_id,
project_id=project_id,
)
collect_span_metrics(project, data)
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this into save_event_transaction, and / or wrap it in a try / catch?

This line is part of a try block, but it only DLQs KeyErrors. Any other failure might block the consumer and cause a P0 incident.

# Raise the retriable exception and skip DLQ if anything below this point fails as it may be caused by
# intermittent network issue

Copy link
Member Author

Choose a reason for hiding this comment

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

Wrap in a try/catch is a good idea, sure 👍

@k-fish k-fish merged commit eace50a into master Aug 2, 2024
49 of 50 checks passed
@k-fish k-fish deleted the ref/am1/add-metrics-span-count branch August 2, 2024 18:49
@oioki oioki added the Trigger: Revert add to a merged PR to revert it (skips CI) label Aug 5, 2024
@getsentry-bot
Copy link
Contributor

PR reverted: 2680cfa

getsentry-bot added a commit that referenced this pull request Aug 5, 2024
…5485)"

This reverts commit eace50a.

Co-authored-by: oioki <1127549+oioki@users.noreply.github.com>
@mwarkentin
Copy link
Member

@k-fish this was reverted for INC-842, please review when you're back.

k-fish added a commit that referenced this pull request Aug 8, 2024
We ran into trouble with the previous PR due to a few issues; a typo in
the name, exception logging in the 'has' causing a thundering herd of
exceptions, and the condition order causing the problem to not trip
tests / soak time.

original PR for context: #75485

Notes:
- `am3_tier` vs `am3-tier` as a result of a bad copy paste (out of a
thread instead of the file it's registered)
- `logger.exception` circumventing the `try / except`, already fixed
[here](687086f#diff-9cd8ed7a349a276392e908cabcd613d3647a94eaa5956ae79e4efb604e2c9232L309)
- Conditional order has `organizations:dynamic-sampling` first, which
causes an early shortcut of the `and`
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 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 Trigger: Revert add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants