feat(browser): Emit low cardinality navigation span names - #23550
feat(browser): Emit low cardinality navigation span names#23550logaretm wants to merge 1 commit into
Conversation
Names navigation spans `Navigation` when span streaming is enabled and the SDK has no parameterized route for them. Names in static mode are unchanged.
6eeaeb1 to
97991d2
Compare
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 |
There was a problem hiding this comment.
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.
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); |
There was a problem hiding this comment.
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.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 97991d2. Configure here.


Names navigation spans
Navigationwhen 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.redirectspans share the code path so they get the fallback too, which imo is right.closes #23522