Conversation
…st_low_volume_projects Add support for querying span metrics in boost_low_volume_projects by: - Adding is_segment filter when using SamplingMeasure.SPANS to only count root spans - Using dynamic use_case_id (SPANS vs TRANSACTIONS) based on the measure This allows the task to correctly query span-based metrics that include the is_segment tag to identify root spans.
…st_low_volume_projects Add support for querying span metrics in boost_low_volume_projects by: - Adding is_segment filter when using SamplingMeasure.SPANS to only count root spans - Using dynamic use_case_id (SPANS vs TRANSACTIONS) based on the measure This allows the task to correctly query span-based metrics that include the is_segment tag to identify root spans.
|
|
||
| SPANS = "spans" | ||
| TRANSACTIONS = "transactions" | ||
| SEGMENTS = "segments" |
Contributor
There was a problem hiding this comment.
Bug: The new SamplingMeasure.SEGMENTS enum is defined and configured, but no production code path can ever select it, rendering the feature non-functional.
Severity: MEDIUM
Suggested Fix
Modify the partition_by_measure() function to correctly return SamplingMeasure.SEGMENTS for organizations that should be using this measure. This likely involves adding a new option, such as "dynamic-sampling.measure.segments", and checking for it within the function to route organizations to the new SEGMENTS logic.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/sentry/dynamic_sampling/types.py#L27
Potential issue: The code introduces a new `SamplingMeasure.SEGMENTS` enum member and
its configuration in `MEASURE_CONFIGS` to allow counting spans with the
`is_segment=true` tag. However, the `partition_by_measure()` function, which determines
the sampling measure for an organization, is never updated to return
`SamplingMeasure.SEGMENTS`. It only checks for the `"dynamic-sampling.measure.spans"`
option and returns `SamplingMeasure.SPANS`. As a result, the new logic for counting
segments is never executed in production, and the system will continue to count all
spans instead of just segments. This makes the feature incomplete and non-functional.
Did we get this right? 👍 / 👎 to inform future reviews.
vgrozdanic
approved these changes
Jan 28, 2026
priscilawebdev
pushed a commit
that referenced
this pull request
Feb 2, 2026
…st_low_volume_projects (#106954) Add support for querying span metrics in boost_low_volume_projects by: - Introduces new measure SEGMENTS in addition to SPANS and TRANSACTIONS. This is done primarily to differentiate between spans and segments - spans should continue to be used for the queries for DS on AM3 - Using dynamic use_case_id (SPANS vs TRANSACTIONS) based on the measure
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.
Add support for querying span metrics in boost_low_volume_projects by:
Closes TET-1679