-
Notifications
You must be signed in to change notification settings - Fork 554
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
When should an instrumentation library set a service name attribute? #454
Comments
Could you elaborate on the question? Is this regarding adding service / operation name as a span attribute? Or am I misunderstanding. |
@matej-g thanks for your response. otelmux accepts a service name in its constructor and automatically guesses the operation from the route. Internally, it calls It's not obvious to me when should an instrumentation library accept and set a service name attribute in a span. Should all libraries do that? In retrospect, the operation name has probably nothing to do with the question. |
Got it now. In general, best resource to consult on attributes requirements is the specification, in particular the sections on semantic conventions; in our case it's https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions. Looking at the On the other hand, I see some other instrumentations (namely From my reading, the bottom line is: Unless you're dealing with HTTP server spans, you don't need to set service (or in this case HTTP server) name attribute. |
Thanks! That's kind of what I figured, but |
Yes, I think it should not be setting that attribute, seems redundant (shamefully admitting, I authored that module). Thanks for bringing this up! |
I think this is correct and those modules should not be setting that attribute. |
Correct.
provider := NewTracerProvider(WithResource(resource)) If the code does not pass a While one could create a As such, we need to survey existing instrumentations in this repo and remove cases where they implicitly set a I will create PRs where needed. |
With the merging of #763 I believe there are no longer opentelemetry-go-contrib instrumentations which allow specifying a I believe that means we can close this issue. Will move to review in the OpenTelemetry Release Candidate project. |
* Drop entry from correlation map Entry used to contain stuff like TTL, but right now the notion of entry was dropped from the spec. * Compute exact size of the correlations map The map will be immutable, so spend some more time to ensure that we will not unnecessarily waste some memory on a basically read-only map. * Allow dropping keys from correlations map This is to follow the spec. Before this change it was possible in an awkward way by using Foreach to gather and filter the key-value pairs, and then calling NewMap with a MultiKV MapUpdate. * Document the correlation package * Add missing license blurbs in correlation package * Add tests for deleting items in correlations * Factor out getting map size and test it This is an implementation detail that can't be tested in a black-box manner. * Fix copyright dates * Simplify/disambiguate keySet function parameters/return values * Fix typo in Apply docs * Fix test names * Explain the nonsense of dropping keys from new map
Looking at the current tracing implementations: some of them accept a service name and set that name in the trace, in addition to an operation name (use as the span name).
Is there a convention for accepting a service name? If there is, it's not immediately obvious, because I can see a service name appearing in both server (eg. http) and client (eg. memcached) components as well.
I would assume that setting a service name is enough in the first span of a service, but I could be wrong. So what's the convention here?
Thanks!
The text was updated successfully, but these errors were encountered: