Use of autoinstrumentation-java with chainguard/jre:latest #13814
Unanswered
itsmaneesh
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was using
bellsoft/liberica-openjre-alpine:17.0.5-8
as base image to create our microservice image that usesghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.26.0
for the auto-instrumentation. When I run the image then the service come up and instrumentation was working as well.But, since the Chainguard Image images are free of CVEs, I am trying to use this
cgr.dev/chainguard/jre:latest
as base image to create our microservice image that usesghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.26.0
for the auto-instrumentation. But, when I run this image, I see,OpenTelemetry Javaagent failed to start
error with the below details:NOTE: Chainguard jre latest image has OpenJDK24.
Error:
java.lang.ExceptionInInitializerError at io.opentelemetry.javaagent.tooling.muzzle.AgentTooling.<clinit>(AgentTooling.java:23) at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:144) at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:98) at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:98) at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:53) at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:47) at io.opentelemetry.javaagent.bootstrap.AgentInitializer.execute(AgentInitializer.java:64) at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:46) at io.opentelemetry.javaagent.OpenTelemetryAgent.startAgent(OpenTelemetryAgent.java:57) at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:45) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @5a39699c at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(Unknown Source) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
In order to resolve it, I tried to pass the
jvmFlags
as shown below but i seeClassNotFoundException
jvmFlags = ['--add-opens=java.base/java.lang=ALL-UNNAMED']
Exception:
ERROR [http-nio-8093-exec-1]: org.apache.catalina.core.ContainerBase.[Tomcat-1].[localhost].[/].[dispatcherServletRegistration] {}, [] - Servlet.service() for servlet [dispatcherServletRegistration] in context with path [] threw exception [Handler dispatch failed: java.lang.NoClassDefFoundError: io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons with root cause java.lang.ClassNotFoundException: io.opentelemetry.javaagent.instrumentation.grpc.v1_6.GrpcSingletons at jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) ~[?:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?] at io.grpc.Context.storage(Context.java:106) ~[grpc-api-1.57.1.jar:1.57.1] at io.grpc.Context.current(Context.java:172) ~[grpc-api-1.57.1.jar:1.57.1] at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:988) ~[grpc-core-1.57.1.jar:1.57.1]
Do you guys see anything conflicting / other issue with this OpenJDK24 and
autoinstrumentation-java:1.26.0
combinations? If so, can you please let me know the correct version that you recommend for this case?Thanks
Beta Was this translation helpful? Give feedback.
All reactions