Title: Span streaming: a child span keeps an old `sentry.segment.name` when the root span is renamed after the child ends · Issue #26080 · getsentry/sentry-javascript · GitHub
Open Graph Title: Span streaming: a child span keeps an old `sentry.segment.name` when the root span is renamed after the child ends · Issue #26080 · getsentry/sentry-javascript
X Title: Span streaming: a child span keeps an old `sentry.segment.name` when the root span is renamed after the child ends · Issue #26080 · getsentry/sentry-javascript
Description: SDK: @sentry/node 11.10.0, @sentry/nextjs 11.10.0 · Next.js 16.3.8 Steps to reproduce const Sentry = require('@sentry/node'); Sentry.init({ dsn: '…', tracesSampleRate: 1, traceLifecycle: 'stream', beforeSendSpan: Sentry.withStreamedSpan(...
Open Graph Description: SDK: @sentry/node 11.10.0, @sentry/nextjs 11.10.0 · Next.js 16.3.8 Steps to reproduce const Sentry = require('@sentry/node'); Sentry.init({ dsn: '…', tracesSampleRate: 1, traceLifecycle: 'stream', ...
X Description: SDK: @sentry/node 11.10.0, @sentry/nextjs 11.10.0 · Next.js 16.3.8 Steps to reproduce const Sentry = require('@sentry/node'); Sentry.init({ dsn: '…', tracesSampleRate: 1, traceLifec...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/26080
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Span streaming: a child span keeps an old `sentry.segment.name` when the root span is renamed after the child ends","articleBody":"**SDK:** `@sentry/node` 11.10.0, `@sentry/nextjs` 11.10.0 · Next.js 16.3.8\n\n### Steps to reproduce\n\n```js\nconst Sentry = require('@sentry/node');\nSentry.init({\n dsn: '…',\n tracesSampleRate: 1,\n traceLifecycle: 'stream',\n beforeSendSpan: Sentry.withStreamedSpan(span => {\n console.log(span.name, '-> segment:', span.attributes['sentry.segment.name']);\n return span;\n }),\n});\n\nSentry.startSpan({ name: 'GET' }, root => {\n Sentry.startSpan({ name: 'early child' }, () => {});\n root.updateName('GET /users/:id');\n Sentry.startSpan({ name: 'late child' }, () => {});\n});\n```\n\n### Expected result\n\nAll three spans have the segment name `GET /users/:id`, the root span's final name.\n\n### Actual result\n\n```\nearly child -> segment: GET\nlate child -> segment: GET /users/:id\nGET /users/:id -> segment: GET /users/:id\n```\n\n### Additional context\n\nEach span copies the root span's name when the span is captured. If the root span is renamed later, the spans captured before the rename keep the old name.\n\nIn Next.js this happens on every page request. With span streaming on, `serverSpanHooks.js` renames the root span to the method (\"GET\") when it starts. The route is added only when a span with `next.route` starts. Spans that end before then (for example `resolve page server component`) have the segment name `GET`, so a search for `GET /history` doesn't find them.\n\nExample trace: https://sentry-developer-experience.sentry.io/explore/traces/trace/e0173ae27e174c52837cbd4b5f81e219\n","author":{"url":"https://github.com/sergical","@type":"Person","name":"sergical"},"datePublished":"2026-11-04T03:34:59Z","url":"https://github.com/getsentry/sentry-javascript/issues/26080"}
| 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:62b81171-48dc-5303-1377-c080014a8210 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C308:1FD1:11B7315:17EC895:6B043170 |
| html-safe-nonce | e06d783880c33a154d89d5adeae4c6371b9c4f4755fb794c9292045cdebf1e04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzA4OjFGRDE6MTFCNzMxNToxN0VDODk1OjZCMDQzMTcwIiwidmlzaXRvcl9pZCI6IjU2ODAxMzY2NTA2NzI1ODMwMjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 82e51eaac5cab2c0526202fa6850f97c4c274286101deee65a7ab77fc5bdce18 |
| hovercard-subject-tag | issue:6195775719 |
| 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/26080/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f76038a1cf84467b7aee66ad0b22e43375526ae0a470ff547a0a6adcccc85d97/getsentry/sentry-javascript/issues/26080 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f76038a1cf84467b7aee66ad0b22e43375526ae0a470ff547a0a6adcccc85d97/getsentry/sentry-javascript/issues/26080 |
| og:image:alt | SDK: @sentry/node 11.10.0, @sentry/nextjs 11.10.0 · Next.js 16.3.8 Steps to reproduce const Sentry = require('@sentry/node'); Sentry.init({ dsn: '…', tracesSampleRate: 1, traceLifecycle: 'stream', ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sergical |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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