fix(otel): Use HTTP_URL attribute for client requests#8539
Conversation
Turns out, `HTTP_TARGET` is always the relative path, even for outgoing requests, which omits the host. So we handle this specifically now here.
| } | ||
|
|
||
| // Remove trailing ? and # from the target | ||
| function normalizeTarget(httpTarget: string): string { |
There was a problem hiding this comment.
We have a helper for this, stripUrlQueryAndFragment
There was a problem hiding this comment.
ahh nice, I'll use this then 👍
Lms24
left a comment
There was a problem hiding this comment.
LGTM, just out of curiosity (no action required): Do we store the query or fragment somewhere on the span as we do in our own instrumentation?
|
It's actually a very good point! I have started aligning this a bit in a different place, but actually may as well do it here already. |
Turns out,
HTTP_TARGETis always the relative path, even for outgoing requests, which omits the host. So we handle this specifically now here.While at it (and as I'm working a bit in this codebase), I also renamed the files from kebap-case to camelCase, to align with the rest of the codebase better - unless there was a specific reason to use that here @AbhiPrasad ?
Closes #8535