Skip to content

feat(core)!: Stream beforeSendSpan payloads by default#22643

Draft
Lms24 wants to merge 1 commit into
feat/span-streaming-defaultfrom
feat/before-send-span-streamed-default
Draft

feat(core)!: Stream beforeSendSpan payloads by default#22643
Lms24 wants to merge 1 commit into
feat/span-streaming-defaultfrom
feat/before-send-span-streamed-default

Conversation

@Lms24

@Lms24 Lms24 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Change beforeSendSpan to receive StreamedSpanJSON by default, matching the new trace lifecycle default.

Callbacks that intentionally process legacy transaction span JSON can opt in with withStaticSpan. withStreamedSpan remains available as a deprecated compatibility helper and is scheduled for removal in version 12. A private type marker preserves contextual typing for unwrapped streamed callbacks while keeping wrapped static callbacks type-safe.

This is the top PR in the span-streaming-default stack and depends on the default-lifecycle change below it.

Fixes #22349

Made with Cursor

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.9 kB +7% +1.95 kB 🔺
@sentry/browser - with treeshaking flags 28.08 kB +6.41% +1.69 kB 🔺
@sentry/browser (incl. Tracing) 48.08 kB +3.61% +1.67 kB 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.08 kB -0.21% -98 B 🔽
@sentry/browser (incl. Tracing, Profiling) 52.87 kB +3.25% +1.66 kB 🔺
@sentry/browser (incl. Tracing, Replay) 87.43 kB +2.04% +1.74 kB 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.79 kB +1.95% +1.46 kB 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.14 kB +1.93% +1.74 kB 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 104.8 kB +1.69% +1.74 kB 🔺
@sentry/browser (incl. Feedback) 47.2 kB +4.61% +2.08 kB 🔺
@sentry/browser (incl. sendFeedback) 34.73 kB +6.09% +1.99 kB 🔺
@sentry/browser (incl. FeedbackAsync) 39.84 kB +5.39% +2.04 kB 🔺
@sentry/browser (incl. Metrics) 30.99 kB +6.71% +1.95 kB 🔺
@sentry/browser (incl. Logs) 31.21 kB +6.68% +1.95 kB 🔺
@sentry/browser (incl. Metrics & Logs) 31.88 kB +6.38% +1.91 kB 🔺
@sentry/react 31.75 kB +6.73% +2 kB 🔺
@sentry/react (incl. Tracing) 50.4 kB +3.47% +1.69 kB 🔺
@sentry/vue 35.11 kB +5.18% +1.73 kB 🔺
@sentry/vue (incl. Tracing) 50.07 kB +3.47% +1.68 kB 🔺
@sentry/svelte 29.93 kB +7.03% +1.96 kB 🔺
CDN Bundle 31.91 kB +5.36% +1.62 kB 🔺
CDN Bundle (incl. Tracing) 48.32 kB +0.14% +65 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.45 kB +5.04% +1.6 kB 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.64 kB +0.13% +64 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.8 kB +2.36% +1.67 kB 🔺
CDN Bundle (incl. Tracing, Replay) 85.89 kB +0.07% +60 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.22 kB +0.1% +82 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.7 kB +0.11% +94 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.98 kB +0.11% +94 B 🔺
CDN Bundle - uncompressed 95.36 kB +5.79% +5.22 kB 🔺
CDN Bundle (incl. Tracing) - uncompressed 145.41 kB +0.14% +194 B 🔺
⛔️ CDN Bundle (incl. Logs, Metrics) - uncompressed (max: 100 kB) 100.07 kB +5.5% +5.22 kB 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.39 kB +0.14% +194 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.84 kB +2.38% +5.22 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.65 kB +0.08% +194 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.62 kB +0.08% +194 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.35 kB +0.07% +194 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.31 kB +0.07% +194 B 🔺
@sentry/nextjs (client) 52.91 kB +3.27% +1.68 kB 🔺
@sentry/sveltekit (client) 48.55 kB +3.65% +1.71 kB 🔺
@sentry/core/server 80.1 kB +0.06% +48 B 🔺
@sentry/core/browser 52.07 kB +0.12% +59 B 🔺
@sentry/node 123.18 kB +0.04% +41 B 🔺
@sentry/node (incl. diagnostics channel injection) 167.18 kB +0.03% +38 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 73.34 kB +0.06% +39 B 🔺
@sentry/aws-serverless 82.86 kB +0.05% +41 B 🔺
@sentry/cloudflare (withSentry) - minified 197.25 kB +0.1% +195 B 🔺
@sentry/cloudflare (withSentry) 485.07 kB +0.07% +337 B 🔺

View base workflow run

Make streamed span JSON the default beforeSendSpan contract and provide
withStaticSpan for callbacks that still process transaction span JSON.
Deprecate withStreamedSpan for removal in version 12.

BREAKING CHANGE: beforeSendSpan receives StreamedSpanJSON by default.
Fixes #22349
Co-Authored-By: Cursor <cursoragent@cursor.com>

Co-authored-by: Cursor <cursoragent@cursor.com>
@Lms24
Lms24 force-pushed the feat/span-streaming-default branch from 2eeaff8 to bf07f9b Compare July 27, 2026 08:41
@Lms24
Lms24 force-pushed the feat/before-send-span-streamed-default branch from a32a10f to bec33b0 Compare July 27, 2026 08:41
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.

Make streamed span types the default in public APIs

1 participant