-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move otelhttp/internal/semconvutil
into otelhttp
#4580
Comments
otelhttp/internal/semconvutil into
otelhttp`
otelhttp/internal/semconvutil into
otelhttp`otelhttp/internal/semconvutil
into otelhttp
I don't think we want to expose this package without a serious review. It is not designed with stability in mind and is likely going to have major breaking changes as the semantic conventions evolve. |
Thanks for the context on https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/internal/shared/semconvutil Even if the semantic conventions evolve, it would be nice to stay consistent with the ones that are currently in use by the instrumentation libraries in question. What would you recommend as a way to go forward? What I can think of right now is to
Does that make sense or do you see another route to re-use as much code as possible? |
It makes sense. This is what I suggested a few times. |
Hi, what's the status? I want to implement my own transport instrumentation but can't use the same semconvutil because the package is internal. |
This hasn't moved yet. The stability of otelhttp, and semconvutil is still not there. |
I got it, but we already rely on it in the instrumentations. What's the difference of consuming them directly from using them indirectly? In both cases, a breaking change could break my system. Therefore e.g. |
There's a difference between providing backwards compatibility with the provided intrumentation (the attributes remain compatible), and providing a backwards compatible API. The latter is a much bigger constraint. |
There are no API guarantees below v1. Several breaking changes has been made since. #4707 (comment) I don't want to start a general discussion about backwards compatibility. I just see the need that people want to rely on the semconvutil to not reinvent the wheel. I see no reason why we should not export them with the same guarantees as the modules that rely on it. Considering, that both are below semver v1. |
I think we could consider exporting (exposing) helper functions in I think it will not have that much issues like we did when We would need to make sure to properly design the new API to make it usable and forward-compatible. However, first I would ask why the users cannot simply use @els0r @StarpTech, can you please share if you could use |
I'm having the same problem. For me, with the "tempoary" deprecation of otelecho, it was the point to create an own implementation. But this is nearly impossible unless you have access to semconvutil without reinvent the wheel for attributes and status. oteltrace.WithAttributes(semconvutil.HTTPServerRequest(service, request)...),
//[...]
span.SetStatus(semconvutil.HTTPServerStatus(status)) In my case, I created a middlware that handle metrics, logs & traces in one place which has some benefits (for me). but the only way was to "copy" the "semconvutil" to my code whitch is not a viable solution. |
@pellared main reason is the rapid evolution of semconv attributes in the middleware. We distribute software and rely on the exact attribute naming. We can't just upgrade and don't want to when naming changes or new attributes are added. |
Any news on this? |
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 otherRoundTripper
s 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
fromgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil
togo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/semconvutil
Alternatives
semconvutil
to internal instrumentation library. Which isn't really maintainableotelhttp
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.
The text was updated successfully, but these errors were encountered: