opentelemetry-operator icon indicating copy to clipboard operation
opentelemetry-operator copied to clipboard

Outdated Java autoinstrumentation version

Open mariusgiger opened this issue 6 months ago • 5 comments
trafficstars

Component(s)

No response

Describe the issue you're reporting

We are currently trying to setup OTEL for microservices using Spring Boot with the Java auto instrumentation. We are using the reactive stack with Webflux and MongoDB.

Spans reported by the MongoDB auto instrumentation (io.opentelemetry.mongo-3.1) were not linked to the parent span of the HTTP request. This resulted in many different spans being reported for each call.

We were able to resolve this issue by hardcoding the image of the autoinstrumentation:

kind: Instrumentation
...
spec:
  java:
    image: "ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:2.15.0"

The default image when creating an Instrumentation resource is set to 1.33.6 which is an older version that apparently has this bug.

The version is hardcoded here.

Can this safely be updated? If yes, I will open a PR.

mariusgiger avatar May 02 '25 16:05 mariusgiger

Looks like versions.txt in the root directory is out of date for the java and dotnet. If you check autoinstrumentation/java/version.txt and autoinstrumentation/dotnet/version.txt, both have newer versions specified in there than the root versions.txt file.

We should probably update the dotnet one as well.

larrys avatar May 02 '25 16:05 larrys

when checking in the Release instructions it specifically states to not bump these versions

DO NOT BUMP JAVA PAST 1.X.X AND DO NOT BUMP .NET PAST 1.2.0. Upgrades past these versions will introduce breaking HTTP semantic convention changes.

mariusgiger avatar May 02 '25 16:05 mariusgiger

Ah... I am building my own image for both the collector and the autoinstrumentation images, so I have not run into the issue you described, and gives me better control over the versions...

larrys avatar May 02 '25 16:05 larrys

Release instructions says that we cannot use the 2.x.x for java but if we look at the version in autoinstrumentation/java it says 2.15.0 ?

So as I understand the Release instructions are outdated no ?

@pavolloffay, I see that you merge update on that last time https://github.com/open-telemetry/opentelemetry-operator/pull/3896, can you say if it is safe to use 2.x.x for java with operator or not. In this case Release instructions should be updated.

guillomep avatar May 06 '25 14:05 guillomep

It's safe to use any Java instrumentation image published by the opentelemetry-operator project. 1.33.6 is the default because of a high-impact breaking change introduced in 2.0. See https://github.com/open-telemetry/opentelemetry-operator/issues/2542 if you'd like more details. We still haven't fully figured out how to make this upgrade without seriously breaking users' environments, as the http instrumentation is one of the most used ones.

On an operational note, https://github.com/open-telemetry/opentelemetry-operator/blob/main/autoinstrumentation/java/version.txt contains the version of the most recently released Java autoinstrumentation image. Whereas https://github.com/open-telemetry/opentelemetry-operator/blob/91c65cc81ac9f44cc57496ccd83fdd72f1b54e42/versions.txt#L18 is the operator's default image, and this is the one that shouldn't be upgraded. I hope this helps clear up the confusion.

swiatekm avatar May 12 '25 23:05 swiatekm