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

fix(spans): Prevent duplicate extraction of score.total metric #3324

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Mar 25, 2024

Since #3273, we accidentally emit the metric d:transactions/measurements.score.total@ratio twice for every transaction.

This happens because the metric is not only extracted from transactions, but also from spans:

MetricSpec {
category: DataCategory::Span,
mri: "d:transactions/measurements.score.total@ratio".into(),

As a quick fix, extract that metric only if the span is not a segment span extracted from a transaction. Long-term, we should stop extracting that transaction metric from spans, and base performance score computation on "d:spans/webvital.score.total@ratio instead.

@jjbayer jjbayer changed the title wip fix(spans): Prevent duplicate extraction of score.total metric Mar 25, 2024
@jjbayer jjbayer force-pushed the fix/transaction-metrics-2x branch from 3151bf8 to b359e1f Compare March 25, 2024 19:45
):
score_total_seen += 1

assert score_total_seen == 1
Copy link
Member Author

Choose a reason for hiding this comment

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

Without the extra condition, this test fails with 2 == 1.

@jjbayer jjbayer marked this pull request as ready for review March 25, 2024 20:02
@jjbayer jjbayer requested a review from a team as a code owner March 25, 2024 20:02
Copy link
Contributor

@edwardgou-sentry edwardgou-sentry left a comment

Choose a reason for hiding this comment

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

Thank you!

@jjbayer jjbayer merged commit bd03227 into master Mar 26, 2024
20 checks passed
@jjbayer jjbayer deleted the fix/transaction-metrics-2x branch March 26, 2024 08:01
edwardgou-sentry added a commit to getsentry/sentry that referenced this pull request Jul 2, 2024
…lculation workaround (#73506)

It has been over 90 days since we fixed an issue with double counting
transactions (getsentry/relay#3324), so we no
longer need this score calculation workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants