Skip to content

fix(replays): Record sentry._internal.replay_is_buffering for spans - #21297

Merged
mjq merged 1 commit into
developfrom
mjq/span-replay-is-buffering
Jun 2, 2026
Merged

fix(replays): Record sentry._internal.replay_is_buffering for spans#21297
mjq merged 1 commit into
developfrom
mjq/span-replay-is-buffering

Conversation

@mjq

@mjqmjq commented Jun 2, 2026

Copy link
Copy Markdown
Member

The currently replay ID is stored using the sentry.replay_id attribute. This attribute is set when the current replay's recording mode is either sampled (i.e. it will be sent to Sentry) or buffer (i.e. it may be sent to Sentry, if an error occurs). Because a buffered replay might not actually be sent to Sentry, logs and metrics set an additional sentry._internal.replay_is_buffering attribute so that the product knows it can't assume the replay actually exists:

constreplayId=replay?.getReplayId(true);
setLogAttribute(processedLogAttributes,'sentry.replay_id',replayId);
if(replayId&&replay?.getRecordingMode()==='buffer'){
// We send this so we can identify cases where the replayId is attached but the replay itself might not have been sent to Sentry
setLogAttribute(processedLogAttributes,'sentry._internal.replay_is_buffering',true);
}

constreplayId=replay?.getReplayId(true);
setMetricAttribute(processedMetricAttributes,'sentry.replay_id',replayId);
if(replayId&&replay?.getRecordingMode()==='buffer'){
setMetricAttribute(processedMetricAttributes,'sentry._internal.replay_is_buffering',true);
}

Spans, however, don't currently set this attribute. For consistency, set it on spans too.


🤖: Used Claude Code (Opus 4.6) to generate the code, with human refactoring + careful review.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.2 kB--
@sentry/browser - with treeshaking flags25.65 kB--
@sentry/browser (incl. Tracing)45.25 kB--
@sentry/browser (incl. Tracing + Span Streaming)47.48 kB--
@sentry/browser (incl. Tracing, Profiling)50.24 kB--
@sentry/browser (incl. Tracing, Replay)84.87 kB+0.04%+26 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags74.44 kB+0.04%+28 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)89.58 kB+0.03%+26 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)102.2 kB+0.03%+26 B 🔺
@sentry/browser (incl. Feedback)44.36 kB--
@sentry/browser (incl. sendFeedback)32.02 kB--
@sentry/browser (incl. FeedbackAsync)37.11 kB--
@sentry/browser (incl. Metrics)28.27 kB--
@sentry/browser (incl. Logs)28.51 kB--
@sentry/browser (incl. Metrics & Logs)29.22 kB--
@sentry/react29.03 kB--
@sentry/react (incl. Tracing)47.53 kB--
@sentry/vue32.22 kB--
@sentry/vue (incl. Tracing)47.17 kB--
@sentry/svelte27.23 kB--
CDN Bundle29.57 kB--
CDN Bundle (incl. Tracing)47.82 kB--
CDN Bundle (incl. Logs, Metrics)31.08 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)49.06 kB--
CDN Bundle (incl. Replay, Logs, Metrics)70.36 kB+0.04%+28 B 🔺
CDN Bundle (incl. Tracing, Replay)85.22 kB+0.04%+26 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)86.39 kB+0.04%+31 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)91.08 kB+0.03%+26 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.23 kB+0.03%+25 B 🔺
CDN Bundle - uncompressed87.7 kB--
CDN Bundle (incl. Tracing) - uncompressed144.13 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed92.19 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed147.88 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed217 kB+0.05%+88 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed262.99 kB+0.04%+88 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed266.74 kB+0.04%+88 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed276.69 kB+0.04%+88 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed280.42 kB+0.04%+88 B 🔺
@sentry/nextjs (client)50.05 kB--
@sentry/sveltekit (client)45.71 kB--
@sentry/core/server75.94 kB--
@sentry/core/browser63.09 kB--
@sentry/node-core61.69 kB-0.01%-1 B 🔽
@sentry/node130.4 kB--
@sentry/node - without tracing74.06 kB+0.01%+3 B 🔺
@sentry/aws-serverless86.26 kB-0.01%-1 B 🔽
@sentry/cloudflare (withSentry) - minified171.85 kB--
@sentry/cloudflare (withSentry)429.49 kB--

View base workflow run

@mjq
mjq marked this pull request as ready for review June 2, 2026 15:55
@mjq
mjq requested a review from a team as a code ownerJune 2, 2026 15:55
@mjq
mjq requested review from Lms24 and logaretm and removed request for a teamJune 2, 2026 15:55
@mjq
mjq merged commit dd2cf92 into developJun 2, 2026
190 of 191 checks passed
@mjq
mjq deleted the mjq/span-replay-is-buffering branch June 2, 2026 16:08
Sign up for freeto 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.

2 participants

@mjq@logaretm