feat(occurrences on eap): Implement EAP query for tagstore group tag value count#111868
Open
feat(occurrences on eap): Implement EAP query for tagstore group tag value count#111868
Conversation
Comment on lines
+918
to
+919
| start=now - timedelta(days=90), | ||
| end=now, |
Contributor
There was a problem hiding this comment.
Bug: The EAP query uses a fixed 90-day time window, while the control Snuba query uses a dynamic window, causing systematic undercounting for older groups.
Severity: HIGH
Suggested Fix
Align the time windows between the control and experimental paths. The start and end datetime objects used for the main Snuba query should be passed to the count_occurrences call in the experimental path, replacing the hardcoded now - timedelta(days=90) value.
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/tagstore/snuba/backend.py#L918-L919
Potential issue: The experimental EAP query path in `get_group_tag_value_count` uses a
hardcoded 90-day time window for its `count_occurrences` call. However, the control path
(the existing Snuba query) uses a dynamic time window that can be much larger, often
extending back to the group's `first_seen` date. This discrepancy causes the
experimental path to systematically undercount events for any group older than 90 days.
While this currently only affects experiment telemetry, it would lead to incorrect data
being displayed in production if this experimental code path were to be promoted.
Did we get this right? 👍 / 👎 to inform future reviews.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements double reads of occurrences from EAP for
get_group_tag_value_countinsrc/sentry/tagstore/snuba/backend.py.