Skip to content

feat(browser): Emit low cardinality navigation span names - #23550

Open
logaretm wants to merge 1 commit into
developfrom
awad/js-3407-emit-low-cardinality-navigation-span-names
Open

feat(browser): Emit low cardinality navigation span names#23550
logaretm wants to merge 1 commit into
developfrom
awad/js-3407-emit-low-cardinality-navigation-span-names

Conversation

@logaretm

@logaretm logaretm commented Aug 24, 2026

Copy link
Copy Markdown
Member

Names navigation spans Navigation when span streaming is enabled and the SDK has no parameterized route for them. Names in static mode are unchanged.

The scope's transaction name keeps the URL, since that's what error events group by. navigation.redirect spans share the code path so they get the fallback too, which imo is right.

closes #23522

@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

JS-3407

Names navigation spans `Navigation` when span streaming is enabled and the SDK has no parameterized route for them. Names in static mode are unchanged.
@logaretm
logaretm force-pushed the awad/js-3407-emit-low-cardinality-navigation-span-names branch from 6eeaeb1 to 97991d2 Compare August 24, 2026 18:47
@github-actions

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.37 kB +0.06% +28 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.39 kB +0.07% +31 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.27 kB +0.04% +16 B 🔺
@sentry/browser (incl. Tracing, Replay) 87.77 kB +0.04% +30 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.23 kB +0.04% +25 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.47 kB +0.03% +25 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.14 kB +0.02% +15 B 🔺
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.56 kB +0.07% +32 B 🔺
@sentry/vue 35.4 kB - -
@sentry/vue (incl. Tracing) 50.38 kB +0.11% +55 B 🔺
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 48.9 kB +0.06% +29 B 🔺
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.77 kB +0.06% +29 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.91 kB - -
CDN Bundle (incl. Tracing, Replay) 86.36 kB +0.04% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.2 kB +0.06% +49 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.09 kB +0.03% +21 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.03 kB +0.04% +29 B 🔺
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.21 kB +0.06% +83 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.9 kB +0.06% +83 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.48 kB +0.04% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.15 kB +0.04% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.18 kB +0.03% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 284.84 kB +0.03% +83 B 🔺
@sentry/nextjs (client) 53.12 kB +0.11% +57 B 🔺
@sentry/sveltekit (client) 48.78 kB +0.07% +30 B 🔺
@sentry/core/server 64.95 kB - -
@sentry/core/browser 52.11 kB - -
@sentry/node 117.49 kB +0.02% +23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.03 kB +0.03% +23 B 🔺
@sentry/aws-serverless 91.46 kB +0.03% +21 B 🔺
@sentry/cloudflare (withSentry) - minified 194.68 kB - -
@sentry/cloudflare (withSentry) 481.3 kB - -

View base workflow run

@logaretm
logaretm marked this pull request as ready for review August 24, 2026 19:38
@logaretm
logaretm requested review from a team as code owners August 24, 2026 19:38
@logaretm
logaretm requested review from Lms24, chargome, msonnb and nicohrubec and removed request for a team August 24, 2026 19:38

@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 2 potential issues.

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 97991d2. Configure here.

} else {
// No matched route - update back-button navigations and set source to url
const { attributes, name: spanName } = spanToJSON(rootSpan);
// With span streaming, a back navigation span is already named `Navigation` (there is no

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Solid overwrites Navigation name

Medium Severity

With span streaming, navigation spans correctly start as Navigation, but this update path can still call updateName with the raw pathname when a match has no route.pattern. That reintroduces a high-cardinality URL name after the fallback was applied.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 97991d2. Configure here.

span.updateName(pathname);
// With span streaming, span names have to be low cardinality, so we can't fall back to the URL.
const client = getClient();
span.updateName(client && hasSpanStreamingEnabled(client) ? NAVIGATION_SPAN_NAME_FALLBACK : pathname);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoidable getClient in utils

Low Severity

This is more an “is this necessary” check than a hard violation: updateNavigationSpanUrlFromLocation newly calls getClient() to gate the streaming name. Callers already have or can receive a client, so threading it through would avoid creating/relying on a current client in multi-client setups.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 97991d2. Configure here.

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.

Emit low cardinality navigation span names

1 participant