-
Notifications
You must be signed in to change notification settings - Fork 873
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
Auto-instrumentation with JMX #9336
Comments
Ping @PeterF778 -- is this something you could take a look at? |
Yes, please assign it to me.
Thanks
…________________________________
From: Mateusz Rzeszutek ***@***.***>
Sent: Wednesday, August 30, 2023 3:18 AM
To: open-telemetry/opentelemetry-java-instrumentation ***@***.***>
Cc: Peter Findeisen (pfindeis) ***@***.***>; Mention ***@***.***>
Subject: Re: [open-telemetry/opentelemetry-java-instrumentation] Auto-instrumentation with JMX (Issue #9336)
Ping @PeterF778<https://github.com/PeterF778> -- is this something you could take a look at?
—
Reply to this email directly, view it on GitHub<#9336 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVXBUCIR6ISAM4WWD4DLWATXX4HPNANCNFSM6AAAAAA4C5S7TM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The cause for this issue is that the PlatformMBeanServer is lazily instantiated by the Java runtime. If there are no explicit references to it from the application (or the Java runtime itself), JMX Metric Insight will be unable to find the platform MBeans. |
Providing a fix as PR #9362 |
Looks like the fix landed in #9362 but this wasn't auto closed. Closing now, but please reopen if I have misunderstood. |
Describe the bug
I am trying to implement auto-instrumentation using the jmx-metrics
My aim is to emit a metric on a simple Java application for the thread count.
When I run the command (shown in 'Steps to reproduce') and create a rules file (as instructed in the documentation), the metric described in said rules file is not emitted even when I leave the application running for a while. Yet, when I open jconsole, it gets emitted successfully. I am assuming it is because I am launching a trigger that will help the process out.
Steps to reproduce
Here is the following command launched on my Windows terminal:
java -javaagent:./opentelemetry-javaagent.jar -Dotel.instrumentation.common.default-enabled=false -Dotel.jmx.discovery.delay=1000 -Dotel.jmx.config=config_file.yml -jar my-application.jar
With the config_file.yml being:
Expected behavior
One of the metrics emitted should be the following:
[{"name":"my.own.jvm.thread.count","description":"The current number of threads","unit":"1","sum":{"dataPoints":[{"startTimeUnixNano":"1692280364935098100","timeUnixNano":"1692280484952967900","asInt":"23"}],"aggregationTemporality":2}}]
It is emitted only when we launch jconsole.
Actual behavior
No such metric is emitted when we leave the application to run alone, without any additional help (jconsole).
Javaagent or library instrumentation version
v1.29.0 (latest as of date)
Environment
JDK: 17.0.2
OS:
Additional context
I have opentelemetry configured. It is listening to the default port (4317) and successfully capturing metrics and logging it in a random text file, as per my configuration.
We have no issues on that side.
The text was updated successfully, but these errors were encountered: