Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: OpenTelemetry java agent startup fails with README.md instructions. #729

Open
dotasek opened this issue Aug 26, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@dotasek
Copy link
Contributor

dotasek commented Aug 26, 2024

When starting from docker, there is an exception regarding Jaeger dependencies in the log file.

Here is my startup (I have jaeger running at localhost:14250)

docker run -p 8080:8080 -e JAVA_TOOL_OPTIONS="-javaagent:/app/opentelemetry-javaagent.jar" -e OTEL_TRACES_EXPORTER="jaeger" -e OTEL_SERVICE_NAME="hapi-fhir-server" -e OTEL_EXPORTER_JAEGER_ENDPOINT="http://localhost:14250" <docker-image-id>

This results in the following error in the log:

[otel.javaagent 2024-08-26 15:03:12:412 +0000] [main] INFO io.opentelemetry.exporter.internal.grpc.GrpcExporter - Calling shutdown() multiple times.
OpenTelemetry Javaagent failed to start
io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: otel.traces.exporter set to "jaeger" but opentelemetry-exporter-jaeger not found on classpath. Make sure to add it as a dependency.
        at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureExporter(SpanExporterConfiguration.java:96)
        at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureSpanExporters(SpanExporterConfiguration.java:68)
        at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:58)
        at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:465)
        at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:34)
        at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:123)
        at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:103)
        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:68)
        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.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
@dotasek dotasek added the bug Something isn't working label Aug 26, 2024
@hapifhir hapifhir deleted a comment Aug 26, 2024
@dotasek
Copy link
Contributor Author

dotasek commented Aug 30, 2024

It looks like OpenTelemetry has dropped support for the Jaeger exporter: https://opentelemetry.io/blog/2023/jaeger-exporter-collector-migration/

However, Jaeger will apparently support otlp/jaeger, and there are instructions in the link above on how to use that.

When I have some time, I will experiment with setting that value in these instructions, and will try again:

https://github.com/hapifhir/hapi-fhir-jpaserver-starter#enable-opentelemetry-auto-instrumentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@dotasek and others