open-telemetry / opentelemetry-js-contrib

OpenTelemetry instrumentation for JavaScript modules
https://opentelemetry.io
Apache License 2.0
685 stars 502 forks source link

undici instrumentation does not set `http.url` attribute #2417

Closed timfish closed 1 month ago

timfish commented 1 month ago

I've noticed that the undici instrumentation sets the url.full attribute but does not set the http.url attribute which I would expect for HTTP client spans.

It only sets these attributes: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/9dc58afed8134f95908331bcff35c5d9ec46fe9a/plugins/node/instrumentation-undici/src/undici.ts#L178-L185

timfish commented 1 month ago

Ah, looking at this discussion, this is intensional?

pichlermarc commented 1 month ago

Ah yes, that's intentional. We made it use the latest (stable) semconv, and @opentelemetry/instrumentation-http is still using the old one. @dyladan is currently working on updating @opentelemetry/instrumentation-http, and the spans attributes will then also eventually resemble what the @opentelemetry/instrumentation-undici package produces.

pichlermarc commented 1 month ago

Core PR updating @opentelemetry/instrumentation-http for future reference: https://github.com/open-telemetry/opentelemetry-js/pull/4940

timfish commented 1 month ago

Ok, closing this since it's not a bug!