Problem Statement
The semconvutil package follows semantic conventions for span attributes set during a round-trip of a client-request.
Exposing the utility functions from semconvutil would allow other RoundTrippers to use them, leading to consistent, semconv-aligned telemetry.
In my specific use case, I'm providing a logging transport and would like to use the same attribute keys as the otelhttp transport does.
Proposed Solution
Move semconvutil from go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil to go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/semconvutil
Alternatives
- Copy-pasting the internals of
semconvutil to internal instrumentation library. Which isn't really maintainable
- Or keep the current implementation, which doesn't align with the semantic conventions
- Accessing the attributes of the parent span from the
otelhttp transport (if that's even possible)
Prior Art
Not aware of any.
Additional Context
We have some tools which run a low frequency of client requests and would like to correlate log messages in our system with the corresponding spans we export.
Problem Statement
The
semconvutilpackage follows semantic conventions for span attributes set during a round-trip of a client-request.Exposing the utility functions from
semconvutilwould allow otherRoundTrippers to use them, leading to consistent, semconv-aligned telemetry.In my specific use case, I'm providing a logging transport and would like to use the same attribute keys as the
otelhttptransport does.Proposed Solution
Move
semconvutilfromgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutiltogo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/semconvutilAlternatives
semconvutilto internal instrumentation library. Which isn't really maintainableotelhttptransport (if that's even possible)Prior Art
Not aware of any.
Additional Context
We have some tools which run a low frequency of client requests and would like to correlate log messages in our system with the corresponding spans we export.