Configure APM to collect jmx metrics

Dear all,

Since some days ago, I'm trying to collect jmx metrics from java app and index them to ES in order to visualize them in kibana but without any result.

APM is already configured but it don't give me all metrics. I think that it is possible to add jmx metrics to APM.
Could someone help me to configure apm collecting jmx metrics ? I'm not able to find where to configure apm and whish file should be modified to collect jmx metrics.

Thank you
Jalil

Please go over all possible ways to configure the Java agent and pick the one that is most suitable for you.

Once you have that in place, you can use the capture_jmx_metrics config option. It's not the most trivial one to use, but its documentation is quite comprehensive. It may still require some trial-and-error, so maybe setting the log_level to DEBUG can be useful until you get it right.

I hope this helps.

Thnak you for your help.
I'm using the System properties like this :

-javaagent:Path\to\elastic-apm-agent-1.17.0.jar
-Delastic.apm.service_name=NameOfService
-Delastic.apm.server_urls=http://hostName:8200
-Delastic.apm.application_packages=app_packages

Now in this config, how can I add the jmx capture config ?

Then use it the same, for example:

-Delastic.apm.capture_jmx_metrics="object_name[java.lang:type=GarbageCollector,name=*] attribute[CollectionCount:metric_name=collection_count] attribute[CollectionTime]"

Hello,
thank you for your great help, it works :slight_smile:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.