Skip to content

feat(replays): Record segment names that occur during replay#21851

Merged
Lms24 merged 4 commits into
developfrom
mjq/record-segment-names-in-replay
Jul 7, 2026
Merged

feat(replays): Record segment names that occur during replay#21851
Lms24 merged 4 commits into
developfrom
mjq/record-segment-names-in-replay

Conversation

@mjq

@mjq mjq commented Jun 29, 2026

Copy link
Copy Markdown
Member

Record a new segment_names field on replay events.

This will be used in the product on the Transaction Summary page to fetch replays related to a particular named transaction.

This sidesteps our current issue under span streaming where Replay's buffer mode leads to sentry.replay.id attributes often pointing to missing Replays, which broke the assumption that a "query spans by segment name to get replay IDs, then query replays with those IDs" query flow will return a usable number of results.

Closes REPLAY-937.

@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

REPLAY-937

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.24 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.01 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.01 kB - -
@sentry/browser (incl. Tracing, Replay) 85.53 kB +0.05% +42 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.14 kB +0.06% +42 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 90.23 kB +0.06% +47 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.89 kB +0.05% +47 B 🔺
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.51 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.11 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.24 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.54 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.81 kB +0.06% +38 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.74 kB +0.04% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.03 kB +0.04% +32 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.53 kB +0.04% +35 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.81 kB +0.04% +36 B 🔺
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.96 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.93 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.75 kB +0.07% +153 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.13 kB +0.06% +153 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.09 kB +0.06% +153 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.83 kB +0.06% +153 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.78 kB +0.06% +153 B 🔺
@sentry/nextjs (client) 50.95 kB - -
@sentry/sveltekit (client) 46.65 kB - -
@sentry/core/server 78.38 kB - -
@sentry/core/browser 64.73 kB - -
@sentry/node-core 63.21 kB - -
@sentry/node 123.75 kB -0.01% -1 B 🔽
@sentry/node (incl. diagnostics channel injection) 128.78 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.72 kB - -
@sentry/node - without tracing 74.82 kB - -
@sentry/aws-serverless 85.59 kB -0.01% -1 B 🔽
@sentry/cloudflare (withSentry) - minified 181.68 kB - -
@sentry/cloudflare (withSentry) 449.39 kB - -

View base workflow run

@mjq mjq marked this pull request as ready for review July 2, 2026 16:12
@mjq mjq requested a review from a team as a code owner July 2, 2026 16:12
@mjq mjq requested review from Lms24, logaretm and mydea and removed request for a team July 2, 2026 16:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8f45b63. Configure here.

Comment thread packages/replay-internal/src/coreHandlers/handleProcessSegmentSpan.ts Outdated

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got some m/q comments in there. Also would be great to lock down the static spans (non-streaming) by asserting segmentNames in handleAfterSendEvent.test.ts. The afterSendEvent transaction path is writing names untested as far as I can tell.

Comment thread packages/replay-internal/src/coreHandlers/handleProcessSegmentSpan.ts Outdated
Comment thread packages/replay-internal/src/coreHandlers/handleAfterSendEvent.ts Outdated
@mjq

mjq commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@logaretm Thanks very much! I removed the coupling and added the missing test cases, if you wouldn't mind giving it another look.

@mjq mjq requested a review from logaretm July 6, 2026 20:08

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@Lms24 Lms24 merged commit b99f06f into develop Jul 7, 2026
298 checks passed
@Lms24 Lms24 deleted the mjq/record-segment-names-in-replay branch July 7, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants