Skip to content

feat: Special extrapolation on count alerts only#104183

Merged
shruthilayaj merged 6 commits intomasterfrom
shruthi/feat/special-extrapolation-on-count-alerts-only
Dec 1, 2025
Merged

feat: Special extrapolation on count alerts only#104183
shruthilayaj merged 6 commits intomasterfrom
shruthi/feat/special-extrapolation-on-count-alerts-only

Conversation

@shruthilayaj
Copy link
Copy Markdown
Member

Only do special extrapolation mode for count based alerts since
thats where thresholds will matter.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 1, 2025
assert snuba_query.aggregate == "count_unique(user)"
assert snuba_query.query == "(transaction:/api/*) AND is_transaction:1"
assert snuba_query.extrapolation_mode == ExtrapolationMode.SERVER_WEIGHTED.value
assert snuba_query.extrapolation_mode == ExtrapolationMode.CLIENT_AND_SERVER_WEIGHTED.value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Test expects wrong extrapolation mode for count_unique

The test for count_unique aggregate expects CLIENT_AND_SERVER_WEIGHTED extrapolation mode, but the implementation includes count_unique in COUNT_BASED_ALERT_AGGREAGTES. Since the test uses Dataset.PerformanceMetrics, the implementation would set extrapolation_mode to SERVER_WEIGHTED.value, not CLIENT_AND_SERVER_WEIGHTED.value. Either the test assertion is wrong, or count_unique shouldn't be in the count-based aggregates list.

Fix in Cursor Fix in Web

@shruthilayaj shruthilayaj merged commit faca90e into master Dec 1, 2025
67 checks passed
@shruthilayaj shruthilayaj deleted the shruthi/feat/special-extrapolation-on-count-alerts-only branch December 1, 2025 20:21
jerryzhou196 pushed a commit that referenced this pull request Dec 1, 2025
Only do special extrapolation mode for count based alerts since
thats where thresholds will matter.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2025
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.

2 participants