open-telemetry / opentelemetry-specification

Specifications for OpenTelemetry
https://opentelemetry.io
Apache License 2.0
3.73k stars 888 forks source link

Instrumented library version #1605

Open blumamir opened 3 years ago

blumamir commented 3 years ago

What are you trying to achieve? Similar to Instrumentation Library, I am trying to get the instrumented library version. In case of errors or issues, it can be very helpful to know the library version which was used.

So for example, if I'm using js ioredis auto instrumentation, I know that the instrumentation library version is 0.15.0, but I need to know that the ioredis version is 4.17.3.

Could not find a semantic convention attribute for this. Was it discussed somewhere in the past maybe?

jkwatson commented 3 years ago

It's not specified, but the java instrumentation group has been appending the library version to the instrumentation name. So, like "ioredis-4.17.3" as the name, for example.

blumamir commented 3 years ago

It's not specified, but the java instrumentation group has been appending the library version to the instrumentation name. So, like "ioredis-4.17.3" as the name, for example.

Thanks, Do you know what is the process for suggesting to add such an attribute to semantic conventions? Is it done via Issues? or via oteps

jkwatson commented 3 years ago

It's not specified, but the java instrumentation group has been appending the library version to the instrumentation name. So, like "ioredis-4.17.3" as the name, for example.

Thanks, Do you know what is the process for suggesting to add such an attribute to semantic conventions? Is it done via Issues? or via oteps

You have taken the perfect first step by creating this issue. Thanks!

dyladan commented 3 years ago

It's not specified, but the java instrumentation group has been appending the library version to the instrumentation name. So, like "ioredis-4.17.3" as the name, for example.

So the version of the instrumented library is matched with the name of the instrumenting library? This seems likely terribly confusing for users who aren't aware of this mismatch.

Oberon00 commented 3 years ago

Isn't the version in the instrumentation library name for Java just the lowest version supported by the instrumentation? https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/writing-instrumentation.md#folder-structure

jkwatson commented 3 years ago

It's not specified, but the java instrumentation group has been appending the library version to the instrumentation name. So, like "ioredis-4.17.3" as the name, for example.

So the version of the instrumented library is matched with the name of the instrumenting library? This seems likely terribly confusing for users who aren't aware of this mismatch.

I don't understand the question. The instrumenting library in this case is the java agent, which has a version (like 1.0.0, for example). It seems clear that this is the right value.

jkwatson commented 3 years ago

Isn't the version in the instrumentation library name for Java just the lowest version supported by the instrumentation? https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/writing-instrumentation.md#folder-structure

yes, I was oversimplifying a bit. Thanks for the clarification.

blumamir commented 3 years ago

Hi, So how can I move forward with this?

I think the main issue that needs to be addressed is how to handle instrumentation library (or span) which is instrumenting multiple packages at once (most likely related, but not necessarily). In this case, the attribute will need to an array of package name and version. Another option is to state that one module version should be captured, which is the one that best suite the use-case.

Another issue in my opinion is whether this data should be set as span attribute, or it should be in a separate span property (like instrumentationLibrary).