You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make streamed span types the default in public APIs #22349
Right now, we have a lot of APIs tailored to our SpanJSON type, which reflects the child span protocol in transactions. When span streaming becomes the default, we should adjust our public API to reflect the StreamedSpan type.
This is a breaking change, as some fields have been renamed or removed/added newly in the respective types.
I propose we make these changes:
beforeSendSpan callback will emit a StreamedSpanJSON
To ensure a compatibiltiy path with the transaction fallback, we can export a withTransactionSpan helper, users that users wrap their callback in. This is exactly how the callback today is made compatible with span streaming but flipped once span streaming becomes the default.
spanToJson will emit a StreamedSpanJSON(this is mostly internally used but it's publicly exported)
This ensures the default experience for anyone using spanToJSON matches the type of beforeSendSpan to only confront users with one PoJo span type. Internally, it should also help us write span-streaming-native code.
For us, we'll need a spanToLegacyJSON (naming TBD) which we can expose in transaction code paths (event processors, beforeSendTransaction, etc). Maybe we can avoid exporting this from packages other than core, since it will go away once we remove transcations in v12. Ideally, we work with the new spanToJSON in as many places as possible but this remains TBD.
TBD for v12: We could rename StreamedSpanJSON to SpanJSON for a more concise and intuitive name, since at this point, transactions and legacy child spans will be gone.
changed the title [-]Make streamed span types are the default in public APIs[/-][+]Make streamed span types the default in public APIs[/+]on Jul 17, 2026
Activity
linear-code commentedon Jul 17, 2026
JS-3077
[-]Make streamed span types are the default in public APIs[/-][+]Make streamed span types the default in public APIs[/+]feat(core)!: Stream beforeSendSpan payloads by default
feat(core)!: Stream beforeSendSpan payloads by default
feat(core)!: Stream beforeSendSpan payloads by default
feat(core)!: Stream beforeSendSpan payloads by default
ref(core): Centralize span lifecycle and `beforeSendSpan` validation
feat(core)!: Stream beforeSendSpan payloads by default
ref(core): Centralize span lifecycle and `beforeSendSpan` validation
feat(core)!: Make `beforeSendSpan` compatible with streamed spans by …
feat(core)!: Return `StreamedSpanJSON` from `spanToJSON` (#23238)
feat(core)!: Return `StreamedSpanJSON` from `spanToJSON` (#23238)
github-actions commentedon Sep 23, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #22643, which was included in the 11.0.0 release.