0

Is there any way to get JVM GC pause time metrics in the prometheus format using JMX exporter or any other way? I have used JMX exporter and tried to export the metrics using the following mbean

java.lang:name=G1 Young Generation,type=GarbageCollector

But that one only gives the collection count and total collection time metrics. Not the GC Pause time metrics.

6
  • 1
    You might be able to configure JFR to get pause times and then send that to prometheus. Commented Apr 30, 2024 at 10:09
  • Yeah we know that we can get this from JFR or from the log but we are preferring to get this in the metrics form using the JMX mbean or JMX exporter. Thanks Commented Apr 30, 2024 at 11:06
  • If you get a com.sun.management.GarbageCollectorMXBean, you might be able to obtain the GcInfo which can also contain GC specific attributes. I think this would be equivalent to com.sun.management:type=GarbageCollector or something like that (I don't know much about JMX). Commented Apr 30, 2024 at 12:49
  • Yeah this one is the GarbageCollector mbean that I was trying to use. It only exposes collection time and collection counts. Not Safepoints sync time, gc pause time etc. Commented Apr 30, 2024 at 13:17
  • Are you using the one from com.sun.management or the one from java.lang.management? I think only the former has GcInfo. Commented Apr 30, 2024 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.