-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(replays): Quick poc of replays on the events endpoint #104083
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?
Conversation
wmak
commented
Nov 26, 2025
- This adds a replays dataset to the events endpoint since we're going to be adding replays to EAP
- I need to go through all the attributes on replays still and figure out if any of them will have different public aliases etc. but for now I just want to get the base work up of allowing these queries
- This adds a replays dataset to the events endpoint since we're going to be adding replays to EAP - I need to go through all the attributes on replays still and figure out if any of them will have different public aliases etc. but for now I just want to get the base work up of allowing these queries
| orderby=orderby, | ||
| offset=offset, | ||
| limit=limit, | ||
| referrer=referrer, | ||
| sampling_mode=sampling_mode, | ||
| page_token=page_token, | ||
| resolver=search_resolver or cls.get_resolver(params, config), | ||
| additional_queries=additional_queries, | ||
| ), | ||
| params.debug, | ||
| ) |
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 Replays dataset, when queried for timeseries data, will raise an unhandled NotImplementedError().
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The Replays class, now exposed via RPC_DATASETS for the events endpoint, lacks implementations for run_timeseries_query(), run_trace_query(), and run_stats_query(). If a user queries organization_events_stats.py with dataset=replays and timeseries parameters, the system will attempt to call run_timeseries_query() on the Replays object, which raises an unhandled NotImplementedError(), resulting in a 500 error.
💡 Suggested Fix
Implement run_timeseries_query(), run_trace_query(), and run_stats_query() methods in the Replays class in src/sentry/snuba/replays.py to handle timeseries, trace, and stats queries, or explicitly prevent these query types for the Replays dataset.
🤖 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/snuba/replays.py#L1-L52
Potential issue: The `Replays` class, now exposed via `RPC_DATASETS` for the events
endpoint, lacks implementations for `run_timeseries_query()`, `run_trace_query()`, and
`run_stats_query()`. If a user queries `organization_events_stats.py` with
`dataset=replays` and timeseries parameters, the system will attempt to call
`run_timeseries_query()` on the `Replays` object, which raises an unhandled
`NotImplementedError()`, resulting in a 500 error.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3917707
| response = requests.post( | ||
| settings.SENTRY_SNUBA + "/tests/entities/replays/insert", json=[replays] | ||
| ) | ||
| assert response.status_code == 200 |
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: Non-EAP path wraps replays list creating nested array
The store_replays method parameter was renamed from replay (singular) to replays (plural), but the non-EAP path (is_eap=False) still wraps the input with json=[replays]. The original code expected a single item and wrapped it in a list. Now that the parameter name suggests a list, if someone passes a list like store_replays([item1, item2], is_eap=False), it creates a nested array [[item1, item2]] instead of [item1, item2], which would cause the API call to fail or behave incorrectly. This is inconsistent with the similar ReplaysAcceptanceTestCase.store_replays() which correctly uses json=replays without extra wrapping.