Update to 1.3.0 throws "opentelemetry-exporter-otlp not found on classpath" error at start
See original GitHub issueDescribe the bug Updating from 1.2.0 to 1.3.0, I now get this printed to stderr when launching my program.
[otel.javaagent 2021-06-29 11:26:55:041 +0800] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.3.1
ERROR io.opentelemetry.javaagent.OpenTelemetryAgent
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:40)
at io.opentelemetry.javaagent.OpenTelemetryAgent.agentmain(OpenTelemetryAgent.java:56)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:50)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: io.opentelemetry.sdk.autoconfigure.ConfigurationException: OTLP Trace Exporter enabled but opentelemetry-exporter-otlp not found on classpath. Make sure to add it as a dependency to enable this feature.
at io.opentelemetry.sdk.autoconfigure.ClasspathUtil.checkClassExists(ClasspathUtil.java:15)
at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureOtlpSpans(SpanExporterConfiguration.java:67)
at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureExporter(SpanExporterConfiguration.java:43)
at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:51)
at io.opentelemetry.sdk.autoconfigure.OpenTelemetrySdkAutoConfiguration.initialize(OpenTelemetrySdkAutoConfiguration.java:47)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installAgentTracer(OpenTelemetryInstaller.java:39)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.beforeAgent(OpenTelemetryInstaller.java:26)
at io.opentelemetry.javaagent.tooling.AgentInstaller.runBeforeAgentListeners(AgentInstaller.java:171)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:114)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:97)
... 13 more
My program completes successfully but no traces are recorded. Checking the java.class.path
system property shows that the opentelemetry-exporter-otlp JARs are there as expected.
Steps to reproduce I don’t have a reproduction to share but this is just a small program with no opentelementry specific code. Just relying on java agent and auto-instrumentation.
What did you expect to see? Should just work out of the box like in 1.2.0.
What version and what artifacts are you using? Artifacts: opentelemetry-exporter-otlp, opentelemetry-javaagent, opentelemetry-sdk-extension-autoconfigure Version: 1.3.0
Environment Compiler: openjdk version “11.0.11” 2021-04-20 OS: Fedora 34
Additional context
In another program, I am calling OpenTelemetrySdkAutoConfiguration.initialize()
at the start. I still do get the error described above but traces do get recorded.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Hi @esamson - we had a mistake in our publishing that caused the vanilla jar to include exporters which wasn’t intended. You want to use the
-all
jar, for example from the link in the release notes to have the exporter.FYI, you don’t need to add the exporter to the classpath yourself (and it doesn’t work since the agent is isolated from the app classpath to prevent conflicts).
Ah. I missed the classifier. Thanks, @anuraaga !