Skip to content

Conversation

@cliffordxing
Copy link
Contributor

@cliffordxing cliffordxing commented Oct 30, 2025

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

@cliffordxing cliffordxing requested a review from a team as a code owner October 30, 2025 18:31
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 30, 2025
@cliffordxing cliffordxing requested a review from phacops October 30, 2025 18:37
Copy link
Contributor

@phacops phacops left a 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"),
Copy link
Contributor

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.

@linear
Copy link

linear bot commented Nov 5, 2025

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 95.77465% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/testutils/cases.py 95.00% 3 Missing ⚠️
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              

@cliffordxing cliffordxing marked this pull request as draft November 7, 2025 17:53
),
],
alias="count_rage_clicks",
),
Copy link
Contributor

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.

Fix in Cursor Fix in Web

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"),
Copy link
Contributor

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.

Fix in Cursor Fix in Web

@cliffordxing cliffordxing merged commit bfe36f1 into master Nov 12, 2025
66 checks passed
@cliffordxing cliffordxing deleted the query-eap-replay branch November 12, 2025 21:47
@sentry
Copy link

sentry bot commented Nov 12, 2025

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
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
cliffordxing added a commit that referenced this pull request Nov 17, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants