diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java index ef45ac208226..a0924738e44b 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java @@ -43,6 +43,7 @@ import net.bytebuddy.description.annotation.AnnotationSource; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.utility.JavaModule; public final class InstrumentationModuleInstaller { @@ -213,7 +214,8 @@ private AgentBuilder installInjectingModule( .transform(ConstantAdjuster.instance()) .transform( (builder, typeDescription, classLoader, module, protectionDomain) -> { - if (instrumentationModule instanceof ExperimentalInstrumentationModule + if (JavaModule.isSupported() + && instrumentationModule instanceof ExperimentalInstrumentationModule && !openerRun.get()) { ExperimentalInstrumentationModule experimentalModule = (ExperimentalInstrumentationModule) instrumentationModule;