question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update to 1.3.0 throws "opentelemetry-exporter-otlp not found on classpath" error at start

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
anuraagacommented, Jun 29, 2021

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).

0reactions
esamsoncommented, Jun 29, 2021

Ah. I missed the classifier. Thanks, @anuraaga !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default client is missing for opentelemetry-exporter-otlp #3123
Given that it is not an API module, this results i... ... Default client is missing for opentelemetry-exporter-otlp #3123.
Read more >
Manual Instrumentation | OpenTelemetry
The application has to install a span processor with an exporter and may customize the behavior of the OpenTelemetry SDK. For example, a...
Read more >
opentelemetry-exporter-otlp-common : 1.3.0 - Maven Central
OpenTelemetry Java - OpenTelemetry Protocol Exporter.
Read more >
Spring Boot Reference Documentation
By default, when a specified config data location does not exist, Spring Boot will throw a ConfigDataLocationNotFoundException and your application will not ...
Read more >
Opentelemetry with Zipkin exporter is not working as expected ...
metrics.exporter=none -Dotel.exporter.zipkin.endpoint=http://localhost:9411/api/v2/spans Maybe the error is on zipkin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found