Skip to content

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 2, 2025

This PR contains the POC span streaming implementation for browser SDKs.

Can be tested on @sentry/browser@10.21.0-alpha.1 and any higher-level SDKs.

To opt into span streaming, set:

Sentry.init({
  dsn: '...',
  tracesSampleRate: 1,
  traceLifecycle: 'stream', <-- 
  integrations: [
    Sentry.browserTracingIntegration();
    Sentry.spanStreamingIntegration(); <-- 
  ],

  // if you use beforeSendSpan, you have to opt into the new serialized span format:
  beforeSendSpan: withStreamSpan(serializedSpan => {
     // do something
     return serializedSpan
   }),
})

Also note that spans will no longer be sent to any event processors added via one if the *.addEventProcessor APIs. If you have any event processors, consider using beforeSendSpan or ignoreSpans.

@Lms24 Lms24 changed the title feat: Span Streaming POC [WIP] feat: Span Streaming POC Oct 2, 2025
@Lms24 Lms24 self-assigned this Oct 2, 2025
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 31db546 to 20590fe Compare October 2, 2025 14:59
Copy link
Contributor

github-actions bot commented Oct 2, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.76 kB +0.47% +115 B 🔺
@sentry/browser - with treeshaking flags 23.27 kB +0.54% +124 B 🔺
@sentry/browser (incl. Tracing) 41.41 kB +1.03% +420 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.69 kB +0.51% +398 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.4 kB +0.62% +421 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.39 kB +0.47% +394 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.61 kB +0.48% +455 B 🔺
@sentry/browser (incl. Feedback) 41.45 kB +0.31% +125 B 🔺
@sentry/browser (incl. sendFeedback) 29.42 kB +0.41% +120 B 🔺
@sentry/browser (incl. FeedbackAsync) 34.36 kB +0.31% +105 B 🔺
@sentry/react 26.45 kB +0.4% +104 B 🔺
@sentry/react (incl. Tracing) 43.41 kB +0.98% +419 B 🔺
@sentry/vue 29.53 kB +1.37% +399 B 🔺
@sentry/vue (incl. Tracing) 43.21 kB +0.99% +420 B 🔺
@sentry/svelte 24.77 kB +0.46% +112 B 🔺
CDN Bundle 27.05 kB +0.43% +114 B 🔺
CDN Bundle (incl. Tracing) 41.95 kB +0.74% +307 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.2 kB +0.4% +306 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.69 kB +0.41% +339 B 🔺
CDN Bundle - uncompressed 79.2 kB +0.32% +247 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 124.76 kB +1% +1.23 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 239.77 kB +0.52% +1.23 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 252.54 kB +0.49% +1.23 kB 🔺
@sentry/nextjs (client) 45.48 kB +0.94% +423 B 🔺
@sentry/sveltekit (client) 41.83 kB +1.01% +415 B 🔺
@sentry/node-core 50.93 kB +0.29% +147 B 🔺
@sentry/node 154.87 kB +0.31% +467 B 🔺
@sentry/node - without tracing 92.81 kB +0.17% +156 B 🔺
@sentry/aws-serverless 106.49 kB +0.15% +149 B 🔺
@sentry/browser (incl. Tracing with Span Streaming) 42.96 kB added added

View base workflow run

Copy link
Contributor

github-actions bot commented Oct 2, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,853 - 9,344 -5%
GET With Sentry 1,422 16% 1,412 +1%
GET With Sentry (error only) 6,147 69% 6,130 +0%
POST Baseline 1,219 - 1,211 +1%
POST With Sentry 527 43% 509 +4%
POST With Sentry (error only) 1,062 87% 1,069 -1%
MYSQL Baseline 3,377 - 3,221 +5%
MYSQL With Sentry 467 14% 370 +26%
MYSQL With Sentry (error only) 2,726 81% 2,625 +4%

View base workflow run

@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 2 times, most recently from 84ec3fe to 4c1a555 Compare October 15, 2025 14:50
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from dc5f6de to a2aec25 Compare October 16, 2025 12:06
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.

2 participants