-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
WIP: Read EAP for tags #103242
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
base: master
Are you sure you want to change the base?
WIP: Read EAP for tags #103242
Conversation
http://localhost:8000/organizations/sentry/issues/17/distributions/?project=1&referrer=issue-stream
|
|
||
| @classmethod | ||
| @sentry_sdk.trace | ||
| def run_table_query( |
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.
If this is hitting the EndpointTraceItemTable and you're trying to get tags, it's incorrect.
You want the attribute names endpoint:
| query_string=f"group_id:{group.id}", | ||
| selected_columns=["id", "group_id"], | ||
| orderby=None, | ||
| offset=0, | ||
| limit=3, | ||
| referrer="tagstore._get_tag_keys_and_top_values", | ||
| config=SearchResolverConfig(auto_fields=True), | ||
| sampling_mode="NORMAL", | ||
| ) | ||
|
|
||
| raise Exception(str(eap_vals)) |
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: Unconditional Exception raised in get_group_tag_keys_and_top_values() when fetching group tags.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The code unconditionally raises an Exception at line 774 within an if True: block, and also in the else branch at line 804. This occurs when GroupTagsEndpoint.get() calls backend.get_group_tag_keys_and_top_values(). The exception is not handled anywhere in the call chain, leading to a 500 error for any client attempting to retrieve group tag data.
💡 Suggested Fix
Remove the if True: block and the raise Exception(...) statements at lines 774 and 804. Implement the intended logic for eap_vals and values_by_key.
🤖 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#L756-L774
Potential issue: The code unconditionally raises an `Exception` at line 774 within an
`if True:` block, and also in the `else` branch at line 804. This occurs when
`GroupTagsEndpoint.get()` calls `backend.get_group_tag_keys_and_top_values()`. The
exception is not handled anywhere in the call chain, leading to a 500 error for any
client attempting to retrieve group tag data.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2618570
| from sentry.models.releaseprojectenvironment import ReleaseProjectEnvironment | ||
| from sentry.models.releases.release_project import ReleaseProject | ||
| from sentry.replays.query import query_replays_dataset_tagkey_values | ||
| from sentry.search.eap.columns import SearchResolverConfig |
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: Incorrect import path for SearchResolverConfig causing ImportError at module load time.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The import statement from sentry.search.eap.columns import SearchResolverConfig at line 29 is incorrect. SearchResolverConfig is defined in sentry.search.eap.types.py and imported into columns.py for internal use, but it is not re-exported. This will cause an ImportError: cannot import name 'SearchResolverConfig' when src/sentry/tagstore/snuba/backend.py is loaded.
💡 Suggested Fix
Change the import statement to from sentry.search.eap.types import SearchResolverConfig.
🤖 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#L29
Potential issue: The import statement `from sentry.search.eap.columns import
SearchResolverConfig` at line 29 is incorrect. `SearchResolverConfig` is defined in
`sentry.search.eap.types.py` and imported into `columns.py` for internal use, but it is
not re-exported. This will cause an `ImportError: cannot import name
'SearchResolverConfig'` when `src/sentry/tagstore/snuba/backend.py` is loaded.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2618570
| if True: | ||
| self._forward_event_to_items(event, event_data, event_type, project) |
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: Feature flag for EAP event forwarding is bypassed, enabling it unconditionally for all events.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The code unconditionally enables event forwarding to the EAP items system for all events from all projects by changing if in_rollout_group(...) to if True. This bypasses the intended gradual rollout mechanism controlled by the eventstream.eap_forwarding_rate option, causing the EAP data pipeline to receive all events instead of a controlled percentage. This could overwhelm the items/trace system, lead to data duplication, or degrade performance.
💡 Suggested Fix
Revert the if True condition to if in_rollout_group("eventstream.eap_forwarding_rate", event.project_id) and re-add the import for in_rollout_group.
🤖 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/eventstream/snuba.py#L214-L215
Potential issue: The code unconditionally enables event forwarding to the EAP items
system for all events from all projects by changing `if in_rollout_group(...)` to `if
True`. This bypasses the intended gradual rollout mechanism controlled by the
`eventstream.eap_forwarding_rate` option, causing the EAP data pipeline to receive all
events instead of a controlled percentage. This could overwhelm the items/trace system,
lead to data duplication, or degrade performance.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2618570
❌ 75 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Not working, returning: