JMX GC metrics not exported after Java 11 upgrade

56 views
Skip to first unread message

marko

unread,
Mar 23, 2020, 5:37:03 PM3/23/20
to Prometheus Users
Hi,

I'm using jmx_prometheus_javaagent v0.12.0 to export JVM metrics to Prometheus.
After upgrading from Java 8 to Java 11 some metrics fail to get exported
e.g. java_lang_GarbageCollector_CollectionCount and java_lang_GarbageCollector_CollectionTime.

Any ideas why this might occur?

marko

marko

unread,
Mar 24, 2020, 3:33:06 AM3/24/20
to Prometheus Users
Just did a manual scraping with the following results:

foo % grep CollectionCount jmx-metrics-java8.txt
java.lang{type=GarbageCollector, name=ParNew}[]CollectionCount: 10659
java.lang{type=GarbageCollector, name=ConcurrentMarkSweep}[]CollectionCount: 24

foo % grep CollectionCount jmx-metrics-java11.txt
java.lang{name=G1 Young Generation, type=GarbageCollector}[]CollectionCount: 811
java.lang{name=G1 Old Generation, type=GarbageCollector}[]CollectionCount: 0

When I do a query in Prometheus with the metric 'java_lang_GarbageCollector_CollectionCount' I get the ParNew and ConcurrentMarkSweep values, but not the G1 ones even though these look exactly the same (java.lang prefix, type=GarbageCollector).
The G1 ones are available however when querying with separate metrics 'java_lang_G1_Young_Generation_CollectionCount' and 'java_lang_G1_Old_Generation_CollectionCount'

Why is that?

marko

unread,
Mar 24, 2020, 3:37:42 AM3/24/20
to Prometheus Users
In the Java 8 scrape the type attribute always seems to be the first one, whereas with the Java 11 one this doesn't always seem to be the case.
Reply all
Reply to author
Forward
0 new messages