feat(core): Emit low-cardinality http.server span names when streaming - #23596
feat(core): Emit low-cardinality http.server span names when streaming#23596chargome wants to merge 1 commit into
Conversation
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>
size-limit report 📦
|
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 75d96fd. Configure here.
| // Route instrumentations rename the span to `${method} ${route}` once a route is known. | ||
| const name = hasSpanStreamingEnabled(client) | ||
| ? request.method?.toUpperCase() || HTTP_SPAN_NAME_FALLBACK | ||
| : `${method} ${httpTargetWithoutQueryFragment}`; |
There was a problem hiding this comment.
Routed spans keep method-only names
High Severity
With streaming enabled, http.server spans start named only after the request method, assuming route instrumentations later rename them to METHOD /route. Native Express and similar integrations only call setTransactionName on the isolation scope and never update the span, so routed requests keep a method-only name.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 75d96fd. Configure here.


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