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

Java agent 1.7.0 fails with prometheus exporter (regression) #4460

Closed
harel-e opened this issue Oct 21, 2021 · 4 comments · Fixed by #4515
Closed

Java agent 1.7.0 fails with prometheus exporter (regression) #4460

harel-e opened this issue Oct 21, 2021 · 4 comments · Fixed by #4515
Labels
bug Something isn't working regression

Comments

@harel-e
Copy link

harel-e commented Oct 21, 2021

I tried to instrument an application with the latest 1.7.0 agent.

I used the following VM params (omitted full cmd for clarify)

-javaagent:opentelemetry-javaagent.jar
-Dotel.metrics.exporter=prometheus
-Dotel.exporter.prometheus.port=9464

I got the exception beflow.
It is working fine with agent version 1.6.2

Environment

JDK : OpenJDK 64-Bit Server VM Temurin-11.0.12+7
OS: MacOS 11.6

[otel.javaagent 2021-10-21 17:13:33:277 +0300] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.7.0
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:51)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:44)
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: java.lang.NoSuchMethodError: 'void io.prometheus.client.exporter.HTTPServer.close()'
at io.opentelemetry.sdk.autoconfigure.MetricExporterConfiguration.configurePrometheusMetrics(MetricExporterConfiguration.java:178)
at io.opentelemetry.sdk.autoconfigure.MetricExporterConfiguration.configureExporter(MetricExporterConfiguration.java:39)
at io.opentelemetry.sdk.autoconfigure.OpenTelemetrySdkAutoConfiguration.configureMeterProvider(OpenTelemetrySdkAutoConfiguration.java:109)
at io.opentelemetry.sdk.autoconfigure.OpenTelemetrySdkAutoConfiguration.initialize(OpenTelemetrySdkAutoConfiguration.java:63)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installAgentTracer(OpenTelemetryInstaller.java:52)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.beforeAgent(OpenTelemetryInstaller.java:34)
at io.opentelemetry.javaagent.tooling.AgentInstaller.runBeforeAgentListeners(AgentInstaller.java:200)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:133)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:111)

@jkwatson
Copy link
Contributor

I'm going to move this issue over to the instrumentation repo, since it applies to the agent.

@jkwatson jkwatson transferred this issue from open-telemetry/opentelemetry-java Oct 21, 2021
@mateuszrzeszutek mateuszrzeszutek added bug Something isn't working regression labels Oct 21, 2021
@mateuszrzeszutek
Copy link
Member

mateuszrzeszutek commented Oct 21, 2021

Looks like the SDK uses prometheus 0.12.0, while the agent still has 0.11.0

@anuraaga
Copy link
Contributor

We should patch this in 1.7.1 - and add a smoke test :)

@harel-e
Copy link
Author

harel-e commented Oct 27, 2021

Thank you. I also verified the fix.

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

Successfully merging a pull request may close this issue.

4 participants