Skip to content

Conversation

@shruthilayaj
Copy link
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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants