feat(v10): Add url.full and url.path to http.server spans#22533
Conversation
…#22496) First part of #22417: This PR adds the `url.full` and `url.path` attributes to all instrumentation that starts or takes over `http.server` spans. To ensure we get a good span description inferred for streamed spans, we need to add the respective attributes to these spans. In a second PR, I'll add `url.template`/`http.route` attributes which should only be set on spans when we have a parameterized route. ref #22417 --------- Co-authored-by: GPT-5.6 Sol <cursoragent@cursor.com>
size-limit report 📦
|
Keep the exact Connect server span assertion aligned with the URL attributes added by the v10 backport. Refs #22496 Co-Authored-By: GPT-5.6 Sol <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Only record `url.full` when the incoming request resolves to an absolute URL, while retaining `url.path` for relative requests without a host. Refs #22496 Co-Authored-By: GPT-5.6 Sol <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Align Node server spans with the URL attribute contract by retaining `url.path` but omitting `url.full` when only a relative request URL exists. Refs #22496 Co-Authored-By: GPT-5.6 Sol <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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 3b3b0dc. Configure here.
| [SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]: method, | ||
| // This is here for backwards compatibility, we used to set this here before | ||
| method, | ||
| [URL_FULL]: ctx.url.href, |
There was a problem hiding this comment.
Astro take-over omits URL attributes
Medium Severity
enhanceHttpServerSpan takes over an existing http.server span but never sets url.full or url.path, while the create path in the same file does. Sibling take-over paths in this PR (SvelteKit, Next.js edge, React Router) set these with a fallback from the request URL. When the prior span lacks them (relative URL, custom instrumentation), Astro streamed spans cannot infer descriptions.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3b3b0dc. Configure here.


Backports #22496 to v10.
Add
url.fullandurl.pathto instrumentation that creates or takes overhttp.serverspans so streamed spans can infer useful descriptions consistently on v10.The Node-side change follows the v10
node-corepackage split; the remaining changes are a direct cherry-pick of the merged PR.Fixes #22417
Made with Cursor