-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: Tag extrapolation mode #103540
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
chore: Tag extrapolation mode #103540
Changes from all commits
51b9bc7
cc7fb06
979d163
396c9a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,10 +90,13 @@ def make_rpc_request( | |
| query_parts, dropped_fields = translate_mep_to_eap(query_parts) | ||
|
|
||
| extrapolation_mode = None | ||
| extrapolation_mode_str = None | ||
| if dataset == Dataset.PerformanceMetrics.value: | ||
| extrapolation_mode = ExtrapolationMode.EXTRAPOLATION_MODE_SERVER_ONLY | ||
| extrapolation_mode_str = "serverOnly" | ||
| if dataset == Dataset.Transactions.value: | ||
| extrapolation_mode = ExtrapolationMode.EXTRAPOLATION_MODE_NONE | ||
| extrapolation_mode_str = "none" | ||
|
|
||
| results = Spans.run_timeseries_query( | ||
| params=snuba_params, | ||
|
|
@@ -103,9 +106,11 @@ def make_rpc_request( | |
| config=SearchResolverConfig( | ||
| extrapolation_mode=extrapolation_mode, | ||
| ), | ||
| sampling_mode=None, | ||
| sampling_mode="NORMAL", | ||
| ) | ||
|
|
||
| sentry_sdk.set_tag("extrapolation_mode", extrapolation_mode_str) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I call this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Zylphrex extrapolation mode isn't the same as sampling mode! extrapolation mode refers to what sampling factors we want to consider for extrapolation (new stuff added so we can migrate alerts)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh my bad, but also oh boy, another mode? |
||
|
|
||
| assert snuba_params.start is not None | ||
| assert snuba_params.end is not None | ||
|
|
||
|
|
@@ -119,6 +124,7 @@ def make_rpc_request( | |
| start=snuba_params.start.strftime("%Y-%m-%dT%H:%M:%S.%fZ"), | ||
| end=snuba_params.end.strftime("%Y-%m-%dT%H:%M:%S.%fZ"), | ||
| sampling="NORMAL", | ||
| extrapolationMode=extrapolation_mode_str, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Extrapolation mode string passed as None to URLWhen |
||
| ) | ||
| sentry_sdk.set_extra("eap_call", api_call) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The
extrapolation_mode_strvariable remainsNonefor unhandled datasets, leading to missing Sentry tags andextrapolationMode=Nonein API calls.Severity: CRITICAL | Confidence: 0.95
🔍 Detailed Analysis
The
extrapolation_mode_strvariable is initialized toNoneand only assigned string values forDataset.PerformanceMetrics.valueandDataset.Transactions.value. Whenmake_rpc_request()is called with otherdatasetvalues,extrapolation_mode_strremainsNone. This causessentry_sdk.set_tag("extrapolation_mode", extrapolation_mode_str)to not set a tag, and the API URL will includeextrapolationMode=None, which downstream APIs may misinterpret or not expect, leading to silent failures for alert rules using unsupported datasets.💡 Suggested Fix
Add an
elseclause orelifto provide a defaultextrapolation_mode_strfor unhandled datasets, or implement input validation to restrictdatasetto supported types.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2780202