feat(core): emit low cardinality request handler span names - #23614
feat(core): emit low cardinality request handler span names#23614isaacs wants to merge 1 commit into
Conversation
|
bugbot run |
There was a problem hiding this comment.
✅ 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 3bf00a6. Configure here.
size-limit report 📦
|
3293c93 to
7673348
Compare
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7673348. Configure here.
277e858 to
9b21ab4
Compare
9b21ab4 to
667c4bd
Compare
679ba4b to
af485cd
Compare
Name `handler` spans after the route they serve when span streaming is enabled, or `Request handler` if no route set. Static mode left as is. Drop Hapi method, as the template dictates. NestJS resolves no route when the span starts. The NestJS callback name stays on `nestjs.callback`. Elysia sets `context.route` when the request enters the compiled handler, which is before the `Handle` phase reports. Read it in the trace listener so streamed handler spans carry the route instead of the `Request handler` fallback. The fallback now applies only when the context has no route. Set `code.function.name` only on the child spans this renames, and only when the handler has a name. Static mode keeps the handler name in the span name, so the attribute adds nothing there, and an anonymous handler has no name to record. Register the Fastify test route from a plugin. Fastify installs the SDK's `onRoute` hook when it flushes its plugin list, which is after root-level routes are in place. A root-level route therefore produces no route handler span, and the test never reached that code path. Also: correct `REQUEST_HANDLER_SPAN_NAME_FALLBACK`: the conventions spell the fallback `Request handler`, and its `@see` link pointed at the resource section. closes #23533 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
7157080 to
620e0d3
Compare

Name
handlerspans after the route they serve when span streaming is enabled, orRequest handlerif no route set. Static mode left as is.Drop Hapi method, as the template dictates. NestJS resolves no route when the span starts. The NestJS callback name stays on
nestjs.callback.Elysia sets
context.routewhen the request enters the compiled handler, which is before theHandlephase reports. Read it in the trace listener so streamed handler spans carry the route instead of theRequest handlerfallback. The fallback now applies only when the context has no route.Set
code.function.nameonly on the child spans this renames, and only when the handler has a name. Static mode keeps the handler name in the span name, so the attribute adds nothing there, and an anonymous handler has no name to record.Register the Fastify test route from a plugin. Fastify installs the SDK's
onRoutehook when it flushes its plugin list, which is after root-level routes are in place. A root-level route therefore produces no route handler span, and the test never reached that code path.Also: correct
REQUEST_HANDLER_SPAN_NAME_FALLBACK: the conventions spell the fallbackRequest handler, and its@seelink pointed at the resource section.closes #23533