Skip to content

fix(core): Strip internal custom span name from streamed spans - #25212

Merged
msonnb merged 2 commits into
developfrom
ms/strip-streamed-custom-span-name
Oct 9, 2026
Merged

msonnb merged 2 commits into
developfrom
ms/strip-streamed-custom-span-name

Conversation

@msonnb

@msonnb msonnb commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Sentry.updateSpanName stores sentry.custom_span_name for internal naming precedence, but streamed spans currently send it to the backend. Remove it during serialization, matching static spans while preserving the renamed span name.

@msonnb
msonnb added this pull request to stack #24891 October 9, 2026 09:02
Comment thread packages/core/src/utils/spanUtils.ts Outdated
export function streamedSpanJsonToSerializedSpan(spanJson: StreamedSpanJSON): SerializedStreamedSpan {
const attributes = serializeAttributes(spanJson.attributes);
// oxlint-disable-next-line typescript/no-dynamic-delete
delete attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wdyt about deleting the attribute in captureSpan right after converting it to JSON?

Doing it here means users would still see it in beforeSendSpan, which I think we should avoid.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point, moved it to captureSpan

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.83 kB - -
@sentry/browser - with treeshaking flags 27.97 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.88 kB - -
@sentry/browser (incl. Tracing) 51.9 kB +0.03% +15 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 51.92 kB +0.03% +15 B 🔺
@sentry/browser (incl. Tracing, Profiling) 54.85 kB +0.03% +15 B 🔺
@sentry/browser (incl. Tracing, Replay) 91.65 kB +0.02% +15 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.52 kB +0.03% +22 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.36 kB +0.02% +16 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.34 kB +0.02% +15 B 🔺
@sentry/browser (incl. Feedback) 47.35 kB - -
@sentry/browser (incl. sendFeedback) 34.87 kB - -
@sentry/browser (incl. FeedbackAsync) 39.99 kB - -
@sentry/browser (incl. Metrics) 30.86 kB - -
@sentry/browser (incl. Logs) 31.15 kB - -
@sentry/browser (incl. Metrics & Logs) 31.79 kB - -
@sentry/react 31.68 kB - -
@sentry/react (incl. Tracing) 54.22 kB +0.03% +13 B 🔺
@sentry/vue 37.9 kB +0.05% +16 B 🔺
@sentry/vue (incl. Tracing) 54.83 kB +0.03% +16 B 🔺
@sentry/svelte 29.86 kB - -
@sentry/remix (Remix 3 client bundle) 56.88 kB +0.03% +13 B 🔺
CDN Bundle 31.57 kB - -
CDN Bundle (incl. Tracing) 52.41 kB +0.03% +15 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.77 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.36 kB +0.03% +13 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.69 kB - -
CDN Bundle (incl. Tracing, Replay) 90.08 kB +0.02% +13 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.02 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.23 kB +0.02% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.2 kB +0.02% +13 B 🔺
CDN Bundle - uncompressed 93.08 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.66 kB +0.03% +44 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.62 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.62 kB +0.03% +44 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.65 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.83 kB +0.02% +44 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.77 kB +0.02% +44 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.53 kB +0.02% +44 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.46 kB +0.02% +44 B 🔺
@sentry/nextjs (client) 56.6 kB +0.03% +15 B 🔺
@sentry/sveltekit (client) 52.28 kB +0.04% +16 B 🔺
@sentry/core/server 40.87 kB +0.04% +13 B 🔺
@sentry/core/browser 13.73 kB +0.11% +14 B 🔺
@sentry/node 151.7 kB +0.01% +15 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.77 kB - -
@sentry/node - without tracing 94.26 kB +0.03% +20 B 🔺
@sentry/node - without channel injection 129.87 kB +0.02% +20 B 🔺
@sentry/aws-serverless 102.43 kB +0.02% +15 B 🔺
@sentry/cloudflare (withSentry) - minified 210.03 kB +0.03% +42 B 🔺
@sentry/cloudflare (withSentry) 520.73 kB +0.03% +109 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 227.7 kB +0.02% +42 B 🔺

View base workflow run

@msonnb
msonnb force-pushed the ms/strip-streamed-custom-span-name branch from 433aade to f4e7e94 Compare October 9, 2026 09:26
@msonnb
msonnb force-pushed the ms/strip-streamed-custom-span-name branch from f4e7e94 to 651f873 Compare October 9, 2026 09:42
@msonnb
msonnb marked this pull request as ready for review October 9, 2026 09:56
@msonnb
msonnb requested a review from a team as a code owner October 9, 2026 09:56
@msonnb
msonnb requested review from Lms24 and logaretm and removed request for a team October 9, 2026 09:56
@msonnb
msonnb force-pushed the ms/strip-streamed-custom-span-name branch from e827f88 to 57789a7 Compare October 9, 2026 10:05
Base automatically changed from ms/browser-tests-requests-web-vitals to develop October 9, 2026 11:02
msonnb and others added 2 commits October 9, 2026 13:02
@msonnb
msonnb force-pushed the ms/strip-streamed-custom-span-name branch from 57789a7 to 9f984f7 Compare October 9, 2026 11:02
@msonnb
msonnb merged commit 3e2e076 into develop Oct 9, 2026
361 checks passed
@msonnb
msonnb deleted the ms/strip-streamed-custom-span-name branch October 9, 2026 11:15
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.

2 participants