Question about Tracer Provider Versions #1040
-
Hi 👋 I've seen in a lot of the documentation and examples, the trace provider being called like this: tracer = OpenTelemetry.tracer_provider.tracer('my-app', '0.1.0') My question is about the version number. If the tracer that I want to get a handle on is one from the auto-instrumentation, Sidekiq for example, then I can do something like this: tracer = OpenTelemetry.tracer_provider.tracer("OpenTelemetry::Instrumentation::Sidekiq", <version>) However the issue with this is that I then have to keep this call up to date whenever the version number of the gem changes or I am potentially creating a new tracer instance with different than intended version here: Is there a recommended way to programatically find the version number for a tracer like this that will keep this updated as the gem gets updated?Should I only be using the tracer provider to find my own custom tracers and not use the auto-instrumenter ones directly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you should create as many named tracers as your application needs and avoid using the tracers created by auto-instrumented libraries. The auto-instrumentation libraries register themselves with the appropriate version when they are installed so there is nothing to be concerned about there. The Interpreting these attributes is vendor specific, e.g. the OTEL Collector maps them as span attributes when exporting them to Jaeger.
HTH |
Beta Was this translation helpful? Give feedback.
Yes, you should create as many named tracers as your application needs and avoid using the tracers created by auto-instrumented libraries. The auto-instrumentation libraries register themselves with the appropriate version when they are installed so there is nothing to be concerned about there.
The
name
andversion
parameters are mapped to OTLPInstrumentationLibrary.name
andInstrumentation.version
when the data is exported to OTLP collectors.Interpreting these attributes is vendor specific, e.g. the OTEL Collector maps them as span attributes when exporting them …