-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(Replay): Add Function to Query EAP for Replay Details #102416
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
Conversation
tests/sentry/replays/endpoints/test_organization_replay_details.py
Outdated
Show resolved
Hide resolved
phacops
left a comment
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.
It would be useful to set up a real feedback loop by inserting data in the EAP and query it as opposed to mocking.
| snuba_query = Query( | ||
| match=Entity("replays"), | ||
| select=[ | ||
| Column("replay_id"), |
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.
Since you're inserting replay breadcrumbs, you'll have many rows for a given replay. You need to use an aggregation to show 1 row per replay.
tests/sentry/replays/endpoints/test_organization_replay_details.py
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #102416 +/- ##
===========================================
+ Coverage 80.28% 80.91% +0.62%
===========================================
Files 8748 8789 +41
Lines 389176 391597 +2421
Branches 24729 24729
===========================================
+ Hits 312445 316845 +4400
+ Misses 76377 74398 -1979
Partials 354 354 |
| ), | ||
| ], | ||
| alias="count_rage_clicks", | ||
| ), |
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: Schema Mismatch Blocks Data Access
The query references Column("click_is_dead") and Column("click_is_rage"), but the actual ingestion code in event_parser.py stores these attributes as is_dead and is_rage (without the click_ prefix). This mismatch will cause the query to fail or return incorrect results when querying production data, though the test passes because the test helper uses the prefixed names.
| Function("count", parameters=[Column("segment_id")], alias="count_segments"), | ||
| Function("sum", parameters=[Column("count_error_events")], alias="count_errors"), | ||
| Function("sum", parameters=[Column("count_warning_events")], alias="count_warnings"), | ||
| Function("sum", parameters=[Column("count_info_events")], alias="count_infos"), |
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: EAP Replay Query: Data Model Discrepancy
The query references count_error_events, count_warning_events, and count_info_events columns that don't exist in the EAP replay dataset. In EAP, replay breadcrumbs are stored with a category attribute (like "error", "warning", "info") rather than separate count columns. The query needs to use conditional aggregations based on the category field instead of trying to sum non-existent columns.
Issues attributed to commits in this pull requestThis pull request was merged and Sentry observed the following issues: |
Adding helper function to allow for query EAP for replay details and added unit test for function. This helper function is not being called yet (planning on adding a flag to gate) Relates to: REPLAY-824
In this [previous PR](#102416), a new helper function for querying EAP for replay details given a replay ID was added to the organization details file. This PR calls this new function behind a new feature flag organizations:replay-details-eap-query. Relates To: https://linear.app/getsentry/issue/REPLAY-825/add-flag-for-reading-from-eap-for-replay-details
Adding helper function to allow for query EAP for replay details and added unit test for function. This helper function is not being called yet (planning on adding a flag to gate)
Relates to: REPLAY-824