Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(browser): Add spanStreamingIntegration#19218

Draft
Lms24 wants to merge 1 commit intolms/feat-core-spanBufferfrom
lms/feat-browser-spanStreamingIntegration
Draft

feat(browser): Add spanStreamingIntegration#19218
Lms24 wants to merge 1 commit intolms/feat-core-spanBufferfrom
lms/feat-browser-spanStreamingIntegration

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Feb 6, 2026

to be merged after #19204

This PR adds the final big building block for span streaming functionality in the browser SDK: spanStreamingIntegation.

This integration:

  • enables traceLifecycle: 'stream' if not already set by users. This allows us to avoid the double-opt-in problem we usually have in browser SDKs because we want to keep integration tree-shakeable but also support the runtime-agnostic traceLifecycle option.
    • to do this properly, I decided to introduce a new integration hook: beforeSetup. This is allows us to safely modify client options before other integrations read it. We'll need this because browserTracingIntegration needs to check for span streaming later on. Let me know what you think!
  • validates that beforeSendSpan is compatible with span streaming. If not, it falls back to static tracing (transactions).
  • listens to a new afterSpanEnd hook. Once called, it will capture the span and hand it off to the span buffer.
  • listens to a new afterSegmentSpanEnd hook. Once called it will flush the trace from the buffer to ensure we flush out the trace as soon as possible. In browser, it's more likely that users refresh or close the tab/window before our buffer's internal flush interval triggers. We don't have to do this but I figured it would be a good trigger point.

While "final building block" sounds nice, there's still a lot of stuff to take care of in the browser. But with this in place we can also start integration-testing the browser SDKs.

ref #17836

@Lms24 Lms24 mentioned this pull request Feb 6, 2026
22 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.47 kB added added
@sentry/browser - with treeshaking flags 23.94 kB added added
@sentry/browser (incl. Tracing) 42.48 kB added added
@sentry/browser (incl. Tracing, Profiling) 47.13 kB added added
@sentry/browser (incl. Tracing, Replay) 81.16 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.74 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 85.86 kB added added
⛔️ @sentry/browser (incl. Tracing, Replay, Feedback) (max: 98 kB) 98.02 kB added added
@sentry/browser (incl. Feedback) 42.19 kB added added
@sentry/browser (incl. sendFeedback) 30.15 kB added added
@sentry/browser (incl. FeedbackAsync) 35.16 kB added added
@sentry/browser (incl. Metrics) 26.59 kB added added
@sentry/browser (incl. Logs) 26.74 kB added added
@sentry/browser (incl. Metrics & Logs) 27.4 kB added added
@sentry/react 27.2 kB added added
@sentry/react (incl. Tracing) 44.73 kB added added
@sentry/vue 30.11 kB added added
@sentry/vue (incl. Tracing) 44.29 kB added added
@sentry/svelte 25.48 kB added added
CDN Bundle 28 kB added added
CDN Bundle (incl. Tracing) 43.25 kB added added
CDN Bundle (incl. Logs, Metrics) 28.85 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 44.1 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 67.8 kB added added
CDN Bundle (incl. Tracing, Replay) 80 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 80.89 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 85.46 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.35 kB added added
CDN Bundle - uncompressed 81.92 kB added added
⛔️ CDN Bundle (incl. Tracing) - uncompressed (max: 128 kB) 128.1 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 84.76 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.93 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.14 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.7 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.52 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.5 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.31 kB added added
⛔️ @sentry/nextjs (client) (max: 47 kB) 47.06 kB added added
@sentry/sveltekit (client) 42.85 kB added added
@sentry/node-core 52.21 kB added added
@sentry/node 166.45 kB added added
@sentry/node - without tracing 93.99 kB added added
@sentry/aws-serverless 109.51 kB added added

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

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 9,147 - - added
GET With Sentry 1,707 19% - added
GET With Sentry (error only) 6,179 68% - added
POST Baseline 1,188 - - added
POST With Sentry 574 48% - added
POST With Sentry (error only) 1,057 89% - added
MYSQL Baseline 3,261 - - added
MYSQL With Sentry 438 13% - added
MYSQL With Sentry (error only) 2,644 81% - 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.

1 participant