Skip to content

feat(core)!: Return StreamedSpanJSON from spanToJSON - #22968

Draft
Lms24 wants to merge 1 commit into
developfrom
lms/ref-spanToJson
Draft

feat(core)!: Return StreamedSpanJSON from spanToJSON#22968
Lms24 wants to merge 1 commit into
developfrom
lms/ref-spanToJson

Conversation

@Lms24

@Lms24 Lms24 commented Aug 3, 2026

Copy link
Copy Markdown
Member
  • feat(core)!: Return StreamedSpanJSON from spanToJSON
  • .
  • fix all usage

Comment thread packages/browser/src/tracing/browserTracingIntegration.ts Outdated
Comment thread packages/react/src/profiler.tsx Outdated
Comment thread packages/solid/src/solidrouter.ts Outdated
Comment thread packages/core/src/utils/spanUtils.ts
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.33 kB +0.02% +4 B 🔺
@sentry/browser - with treeshaking flags 28.55 kB +0.02% +4 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 26.86 kB +0.03% +7 B 🔺
@sentry/browser (incl. Tracing) 49.11 kB +0.06% +27 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 49.13 kB +0.06% +27 B 🔺
@sentry/browser (incl. Tracing, Profiling) 53.9 kB +0.04% +21 B 🔺
@sentry/browser (incl. Tracing, Replay) 88.45 kB +0.03% +20 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.86 kB +0.03% +20 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 93.15 kB +0.03% +24 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.84 kB +0.03% +27 B 🔺
@sentry/browser (incl. Feedback) 47.67 kB +0.01% +3 B 🔺
@sentry/browser (incl. sendFeedback) 35.16 kB +0.01% +3 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.33 kB +0.01% +1 B 🔺
@sentry/browser (incl. Metrics) 31.41 kB +0.02% +4 B 🔺
@sentry/browser (incl. Logs) 31.65 kB +0.01% +1 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.32 kB +0.03% +7 B 🔺
@sentry/react 32.14 kB +0.01% +2 B 🔺
@sentry/react (incl. Tracing) 51.28 kB +0.04% +19 B 🔺
@sentry/vue 35.44 kB -0.01% -1 B 🔽
@sentry/vue (incl. Tracing) 51.07 kB +0.04% +19 B 🔺
@sentry/svelte 30.36 kB +0.01% +3 B 🔺
CDN Bundle 32.35 kB +0.03% +7 B 🔺
CDN Bundle (incl. Tracing) 49.68 kB +0.04% +19 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.88 kB +0.02% +6 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 50.99 kB +0.05% +23 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.4 kB - -
CDN Bundle (incl. Tracing, Replay) 87.21 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.49 kB +0.03% +19 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 93.08 kB +0.02% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.34 kB +0.02% +13 B 🔺
CDN Bundle - uncompressed 95.91 kB +0.04% +34 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 149.1 kB +0.08% +116 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.5 kB +0.04% +34 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.08 kB +0.08% +116 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.44 kB +0.02% +44 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 268.37 kB +0.05% +126 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.33 kB +0.05% +126 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 282.06 kB +0.05% +126 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.02 kB +0.05% +126 B 🔺
@sentry/nextjs (client) 53.85 kB +0.04% +18 B 🔺
@sentry/sveltekit (client) 49.49 kB +0.05% +21 B 🔺
@sentry/core/server 65.79 kB +0.03% +14 B 🔺
@sentry/core/browser 52.02 kB +0.03% +11 B 🔺
@sentry/node 119.43 kB -0.01% -7 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.42 kB +0.01% +7 B 🔺
@sentry/aws-serverless 92.75 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) - minified 214.92 kB +0.02% +29 B 🔺
@sentry/cloudflare (withSentry) 531 kB +0.05% +226 B 🔺

View base workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2327a59. Configure here.

Comment thread packages/core/src/utils/spanUtils.ts Outdated
`spanToJSON` now returns the intermediate `StreamedSpanJSON` representation
instead of the legacy `SpanJSON`. The previous behaviour is still available as
`spanToStaticSpanJSON`, and the old `spanToStreamedSpanJSON` export is gone
(it *is* `spanToJSON` now).

Field mapping for call sites: `description` -> `name`, `data` -> `attributes`,
`timestamp` -> `end_timestamp`, and `op`/`origin` move into `attributes` under
`sentry.op` / `sentry.origin`. `status` is narrowed to `'ok' | 'error'`.

`end_timestamp` is optional on `StreamedSpanJSON` and only required on
`SerializedStreamedSpan`, so the guarantee we actually care about — every span
we *send* has an end timestamp — is enforced at the single serialization
boundary (`streamedSpanJsonToSerializedSpan`) rather than baked into every span
representation. That keeps `end_timestamp` usable as the "has this span ended?"
signal it already was, so the open-span checks in `browserTracingIntegration`,
`idleSpan` and the React Router instrumentation stay simple field reads.
@Lms24
Lms24 force-pushed the lms/ref-spanToJson branch from 9e8fed6 to 598470e Compare August 7, 2026 16:20
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