Title: feat(core): Span serialization utilities (spanToV2JSON) · Issue #19141 · getsentry/sentry-javascript · GitHub
Open Graph Title: feat(core): Span serialization utilities (spanToV2JSON) · Issue #19141 · getsentry/sentry-javascript
X Title: feat(core): Span serialization utilities (spanToV2JSON) · Issue #19141 · getsentry/sentry-javascript
Description: NoteThe pull request "feat(core): Span serialization utilities (spanToV2JSON)" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear. Summary This PR ad...
Open Graph Description: NoteThe pull request "feat(core): Span serialization utilities (spanToV2JSON)" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility in extern...
X Description: NoteThe pull request "feat(core): Span serialization utilities (spanToV2JSON)" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/19141
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(core): Span serialization utilities (spanToV2JSON)","articleBody":"> [!NOTE]\n> The pull request \"[feat(core): Span serialization utilities (spanToV2JSON)](https://github.com/getsentry/sentry-javascript/pull/19140)\" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.\n\n## Summary\n\nThis PR adds span serialization utilities for converting spans to the V2 format, as part of the span streaming feature work.\n\n**Changes:**\n- Add `spanToV2JSON` function to convert spans to `SerializedSpan` (V2 format)\n- Add `getV2SpanLinks` function to convert span links with serialized attributes\n- Add `getV2StatusMessage` function to convert status to `'ok' | 'error'`\n- Rename `getRootSpan` implementation to `INTERNAL_getSegmentSpan` (with `getRootSpan` kept as an alias)\n- Export all new utilities from `@sentry/core`\n\n**Design notes:**\n- `spanToV2JSON` checks for a `getSpanV2JSON` method first (which will be added to SentrySpan in a later PR), then falls back to computing the V2 JSON from the span data\n- This ensures the function works with both SentrySpan and OpenTelemetry SDK spans\n- The `INTERNAL_getSegmentSpan` rename prepares for future changes where \"segment span\" terminology is used instead of \"root span\"\n\n**Dependencies:** PR 1 (SpanV2JSON Types) - already merged\n\n## Test plan\n\n- [x] `yarn lint` passes\n- [x] `yarn test` passes for `@sentry/core`\n- [x] `yarn build:dev` builds successfully\n\nMade with [Cursor](https://cursor.com)\n","author":{"url":"https://github.com/apps/github-actions","@type":"Person","name":"github-actions"},"datePublished":"2026-02-03T14:49:31Z","url":"https://github.com/getsentry/sentry-javascript/issues/19141"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7cd3c7ff-b1cb-d256-863f-566406a85ad5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A300:15A4DC:1F035DD:29BECD6:6B044C8A |
| html-safe-nonce | 7b892cc890b76c41684fa00514a317844282195c06b8961c1ecd7d72d14e124e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzAwOjE1QTREQzoxRjAzNUREOjI5QkVDRDY6NkIwNDRDOEEiLCJ2aXNpdG9yX2lkIjoiMTYxNTQ1NDgxNTIwNTQ3NzUxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8c24584f2a305cc137d1bcd73a1a984b795956ef05bbd8d6e4cfdbbbab7bd26c |
| hovercard-subject-tag | issue:3891654723 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/19141/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8265603e1bffd322873fe53066006a3cf6bfcda582d8af3d57572f41f4166a69/getsentry/sentry-javascript/issues/19141 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8265603e1bffd322873fe53066006a3cf6bfcda582d8af3d57572f41f4166a69/getsentry/sentry-javascript/issues/19141 |
| og:image:alt | NoteThe pull request "feat(core): Span serialization utilities (spanToV2JSON)" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility in extern... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | github-actions[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width