Skip to content

fix(replays): Use Spans dataset when fetching contents of "Trace" tab#115530

Open
gggritso wants to merge 5 commits into
masterfrom
georgegritsouk/replay-915-replay-does-not-find-any-trace-tab-contents-with-streaming
Open

fix(replays): Use Spans dataset when fetching contents of "Trace" tab#115530
gggritso wants to merge 5 commits into
masterfrom
georgegritsouk/replay-915-replay-does-not-find-any-trace-tab-contents-with-streaming

Conversation

@gggritso
Copy link
Copy Markdown
Member

@gggritso gggritso commented May 13, 2026

The SDK team found in REPLAY-915 that the "Trace" tab of a Replay never loads anything when a streaming SDK is used. This is because that tab us implicitly using the "Discover" (i.e., Transactions) dataset, and the transaction dataset fields.

This PR updates the fetch request to use the "spans" dataset. That dataset doesn't support the min() function on the timestamp field nor the max() function on the transaction.duration field, so I updated them both to use the precise timestamp field instead. That also makes the hack that subtracts the duration from the timestamp irrelevant, since we can explicitly ask for min start and max finish.

Closes REPLAY-915.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 13, 2026

REPLAY-915

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.52%

@gggritso
Copy link
Copy Markdown
Member Author

@cursor review

Comment thread static/app/views/explore/replays/detail/trace/useReplayTraces.tsx
…ilable

The old sorting logic subtracted max(transaction.duration) from the min
timestamp to estimate trace start time. After switching to the Spans
dataset, max(precise.finish_ts) is a Unix timestamp—not a duration—so
the arithmetic was incorrect. Since min(precise.start_ts) already gives
the earliest start time directly, sort by that value and drop the unused
max(precise.finish_ts) field from the query.
@gggritso
Copy link
Copy Markdown
Member Author

@cursor review

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 12a8ac4. Configure here.

@gggritso gggritso marked this pull request as ready for review May 14, 2026 14:04
@gggritso gggritso requested a review from a team as a code owner May 14, 2026 14:04
Comment thread static/app/views/explore/replays/detail/trace/useReplayTraces.tsx Outdated
EventView expects the alias format (min_precise_start_ts) rather than
the function format (min(precise.start_ts)) for the orderby parameter.
The function format was silently dropped from the API request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants