feat: Special extrapolation on count alerts only#104183
Merged
shruthilayaj merged 6 commits intomasterfrom Dec 1, 2025
Merged
Conversation
nikkikapadia
approved these changes
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 |
Contributor
There was a problem hiding this comment.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only do special extrapolation mode for count based alerts since
thats where thresholds will matter.