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

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>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.9 kB added added
@sentry/browser - with treeshaking flags 28.08 kB added added
@sentry/browser (incl. Tracing) 48.08 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.08 kB added added
@sentry/browser (incl. Tracing, Profiling) 52.87 kB added added
@sentry/browser (incl. Tracing, Replay) 87.43 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.79 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 92.14 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 104.8 kB added added
@sentry/browser (incl. Feedback) 47.2 kB added added
@sentry/browser (incl. sendFeedback) 34.73 kB added added
@sentry/browser (incl. FeedbackAsync) 39.84 kB added added
@sentry/browser (incl. Metrics) 30.99 kB added added
@sentry/browser (incl. Logs) 31.21 kB added added
@sentry/browser (incl. Metrics & Logs) 31.88 kB added added
@sentry/react 31.75 kB added added
@sentry/react (incl. Tracing) 50.4 kB added added
@sentry/vue 35.11 kB added added
@sentry/vue (incl. Tracing) 50.07 kB added added
@sentry/svelte 29.93 kB added added
CDN Bundle 31.91 kB added added
CDN Bundle (incl. Tracing) 48.32 kB added added
CDN Bundle (incl. Logs, Metrics) 33.45 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.64 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 72.8 kB added added
CDN Bundle (incl. Tracing, Replay) 85.89 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.22 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.7 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.98 kB added added
CDN Bundle - uncompressed 95.36 kB added added
CDN Bundle (incl. Tracing) - uncompressed 145.41 kB added added
⛔️ CDN Bundle (incl. Logs, Metrics) - uncompressed (max: 100 kB) 100.07 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.39 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.84 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.65 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.62 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.35 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.31 kB added added
@sentry/nextjs (client) 52.92 kB added added
@sentry/sveltekit (client) 48.55 kB added added
@sentry/core/server 80.1 kB added added
@sentry/core/browser 52.07 kB added added
@sentry/node 123.18 kB added added
@sentry/node (incl. diagnostics channel injection) 167.18 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node - without tracing 73.34 kB added added
@sentry/aws-serverless 82.86 kB added added
@sentry/cloudflare (withSentry) - minified 197.25 kB added added
@sentry/cloudflare (withSentry) 485.07 kB added added

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