feat(core)!: Enable span streaming by default#22642
Conversation
Default clients to the streamed trace lifecycle and automatically install the required streaming integration in browser and server runtimes. Explicit static lifecycle configuration remains supported. BREAKING CHANGE: Spans use the streamed trace lifecycle unless configured otherwise. Fixes #22344 Co-Authored-By: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2eeaff8. Configure here.
| */ | ||
| protected constructor(options: O) { | ||
| this._options = { attachStacktrace: true, ...options }; | ||
| this._options = { attachStacktrace: true, traceLifecycle: 'stream', ...options }; |
There was a problem hiding this comment.
Stream default drops browser spans
High Severity
Defaulting traceLifecycle to stream on base Client skips the static transaction path, but BrowserClient never auto-installs spanStreamingIntegration. Only init() adds it, unlike ServerRuntimeClient. Constructing BrowserClient directly therefore enables streaming with no flusher, so finished spans are never sent.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2eeaff8. Configure here.
| import { httpContextIntegration } from './integrations/httpcontext'; | ||
| import { linkedErrorsIntegration } from './integrations/linkederrors'; | ||
| import { spotlightBrowserIntegration } from './integrations/spotlight'; | ||
| import { spanStreamingIntegration } from './integrations/spanstreaming'; |
There was a problem hiding this comment.
Browser bundle size increase
Medium Severity
This violates the review rule on large browser bundle size increases. Importing spanStreamingIntegration into sdk.ts pulls SpanBuffer and related streaming code into every bundle that ships init, including non-tracing CDN entry points that previously only exposed a shim.
Additional Locations (1)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 2eeaff8. Configure here.
|
|
||
| if (options.traceLifecycle !== 'static' && !integrations.some(integration => integration.name === 'SpanStreaming')) { | ||
| integrations.push(spanStreamingIntegration()); | ||
| } |
There was a problem hiding this comment.
Missing integration or E2E tests
Medium Severity
This violates the Testing Conventions rule for feat PRs. The change only adds unit coverage that the integration is present in options; there is no integration or E2E test that asserts streamed spans are actually emitted under the new default.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 2eeaff8. Configure here.
size-limit report 📦
|


Make
streamthe default trace lifecycle for server runtime clients and automatically installspanStreamingIntegrationin the browser SDK unless users explicitly select the static lifecycle.Browser users should receive the same default experience as server SDK users, without manually adding the integration. Explicit static configurations and explicit integration lists remain respected, and duplicate streaming integrations are avoided.
This is the middle PR in the span-streaming-default stack and depends on the transaction-test opt-outs below it.
Fixes #22349
Made with Cursor