Describe the bug
When running the OpenTelemetry Java agent on Java 26, the JVM emits the following warning during startup:
From inspection of the packaged agent jar, this appears to come from OpenTelemetry reflectively replacing Byte Buddy's final transformations field on AgentBuilder$Default.
This is especially relevant on Java 26 because of JEP 500, which warns about reflective mutation of final fields:
https://openjdk.org/jeps/500
In Byte Buddy, AgentBuilder.Default declares the field:
protected final List<Transformation> transformations;
Byte Buddy AgentBuilder.java#L10717
OpenTelemetry Java agent, net.bytebuddy.agent.builder.AgentBuilderUtil reflectively accesses and mutates this field:
OpenTelemetry AgentBuilderUtil.java#L135
WARNING: Final field transformations in class net.bytebuddy.agent.builder.AgentBuilder$Default has been mutated reflectively by class net.bytebuddy.agent.builder.AgentBuilderUtil in unnamed module @4e08711f (file:/otel.jar)
Steps to reproduce
Run an application with the OpenTelemetry Java agent on Java 26.
Example startup shape:
java -javaagent:/path/to/otel.jar -jar app.jar
On startup, the JVM emits:
WARNING: Final field transformations in class net.bytebuddy.agent.builder.AgentBuilder$Default has been mutated reflectively by class net.bytebuddy.agent.builder.AgentBuilderUtil in unnamed module @4e08711f (file:/otel.jar)
Expected behavior
Ideally the agent should avoid reflective mutation of final fields on Java 26+, or have a compatibility path that does not trigger JEP 500 warnings.
At minimum, it would be helpful to know:
- whether this warning is expected and safe
- whether there is a plan to remove this reflective final-field mutation
- whether there is a supported workaround besides JVM flags such as:
--enable-final-field-mutation=ALL-UNNAMED, --illegal-final-field-mutation=allow
Actual behavior
The application starts with the JVM warning above when the OpenTelemetry Java agent is enabled on Java 26.
Javaagent or library instrumentation version
v2.26.1
Environment
JDK: 26
OS: Alpine 3.23
Embedded Byte Buddy: 1.18.7
Base image: eclipse-temurin:26-jre-alpine
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
When running the OpenTelemetry Java agent on Java 26, the JVM emits the following warning during startup:
From inspection of the packaged agent jar, this appears to come from OpenTelemetry reflectively replacing Byte Buddy's final transformations field on AgentBuilder$Default.
This is especially relevant on Java 26 because of JEP 500, which warns about reflective mutation of final fields:
https://openjdk.org/jeps/500
In Byte Buddy, AgentBuilder.Default declares the field:
protected final List<Transformation> transformations;Byte Buddy AgentBuilder.java#L10717
OpenTelemetry Java agent, net.bytebuddy.agent.builder.AgentBuilderUtil reflectively accesses and mutates this field:
OpenTelemetry AgentBuilderUtil.java#L135
Steps to reproduce
Run an application with the OpenTelemetry Java agent on Java 26.
Example startup shape:
java -javaagent:/path/to/otel.jar -jar app.jarOn startup, the JVM emits:
Expected behavior
Ideally the agent should avoid reflective mutation of final fields on Java 26+, or have a compatibility path that does not trigger JEP 500 warnings.
At minimum, it would be helpful to know:
--enable-final-field-mutation=ALL-UNNAMED, --illegal-final-field-mutation=allowActual behavior
The application starts with the JVM warning above when the OpenTelemetry Java agent is enabled on Java 26.
Javaagent or library instrumentation version
v2.26.1
Environment
JDK: 26
OS: Alpine 3.23
Embedded Byte Buddy: 1.18.7
Base image: eclipse-temurin:26-jre-alpine
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.