Skip to content

feat(core): Emit low-cardinality http.server span names when streaming - #23596

Merged
chargome merged 2 commits into
developfrom
charlygomez/js-3412-http-span-names-core
Aug 26, 2026
Merged

feat(core): Emit low-cardinality http.server span names when streaming#23596
chargome merged 2 commits into
developfrom
charlygomez/js-3412-http-span-names-core

Conversation

@chargome

Copy link
Copy Markdown
Member

Names http.server spans after the request method instead of the URL path when span streaming is enabled and no route resolved. Routed requests are unchanged, static mode is byte-identical, and the scope's transaction name keeps the full path so error grouping is unaffected.
Refs #23527

@chargome chargome self-assigned this Aug 25, 2026
@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

JS-3412

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.51 kB - -
@sentry/browser (incl. Tracing, Replay) 88.06 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.46 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.76 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.47 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.79 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.82 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.07 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.95 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73 kB - -
CDN Bundle (incl. Tracing, Replay) 86.58 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.27 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.38 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.42 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.18 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.55 kB - -
@sentry/nextjs (client) 53.33 kB - -
@sentry/sveltekit (client) 49.03 kB - -
@sentry/core/server 65.3 kB +0.18% +111 B 🔺
@sentry/core/browser 52.35 kB - -
@sentry/node 122.7 kB +0.05% +60 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.22 kB - -
@sentry/node - without tracing 87.96 kB +0.03% +22 B 🔺
@sentry/aws-serverless 96.18 kB +0.08% +71 B 🔺
@sentry/cloudflare (withSentry) - minified 199.5 kB - -
@sentry/cloudflare (withSentry) 495.46 kB - -

View base workflow run

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

Comment thread packages/core/src/integrations/http/server-subscription.ts
@chargome
chargome force-pushed the charlygomez/js-3412-http-span-names-core branch 5 times, most recently from 09377e8 to e758901 Compare August 26, 2026 09:14
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@chargome
chargome force-pushed the charlygomez/js-3412-http-span-names-core branch from e758901 to 826d73b Compare August 26, 2026 09:28
Comment thread packages/core/src/integrations/express/patch-layer.ts Outdated
Comment thread packages/core/src/integrations/express/patch-layer.ts Outdated
@chargome
chargome force-pushed the charlygomez/js-3412-http-span-names-core branch from 826d73b to 7b17d86 Compare August 26, 2026 10:10
@chargome

Copy link
Copy Markdown
Member Author

bugbot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7b17d86. Configure here.

@chargome
chargome marked this pull request as ready for review August 26, 2026 11:39
@chargome
chargome requested review from a team as code owners August 26, 2026 11:39
@chargome
chargome requested review from JPeer264 and isaacs and removed request for a team August 26, 2026 11:39
@chargome
chargome force-pushed the charlygomez/js-3412-http-span-names-core branch from 7b17d86 to 81ee982 Compare August 26, 2026 12:22
chargome and others added 2 commits August 26, 2026 16:59
With span streaming enabled, an http.server span is named after the request method rather than
the URL path when no route is resolved. Routed requests keep `${method} ${route}`, and `static`
mode is unchanged.

The scope's transaction name keeps the full path, so error grouping is unaffected. Two test suites
matched spans by name and now match on `url.path`, which is what is available at span start.

Refs #23527
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… span

Unlike the Node SDK, which renames the root span via `setHttpServerSpanRouteAttribute`, core's express
integration only set the isolation scope's transaction name. With span streaming that left routed
requests on Bun and Deno stuck with the method-only span name they start with.

Gated on span streaming so `static` mode names are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome
chargome force-pushed the charlygomez/js-3412-http-span-names-core branch from 81ee982 to f2795a3 Compare August 26, 2026 15:00
Comment thread packages/node/src/integrations/http/httpServerSpansIntegration.ts
@chargome
chargome merged commit d4e9ccd into develop Aug 26, 2026
272 checks passed
@chargome
chargome deleted the charlygomez/js-3412-http-span-names-core branch August 26, 2026 15:28
chargome added a commit that referenced this pull request Aug 26, 2026
…23597)

Applies the same span-streaming gate across the runtime and framework
SDKs so no integration keeps a raw URL in an `http.server` span name;
routed requests are unchanged. Stacked on #23596.
Worth a closer look: remix reads its own span name back, sveltekit also
renames SvelteKit's native root span, and nextjs renames in a
`spanStart` hook because Next.js creates that span. Refs #23527

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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