prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.06k stars 1.2k forks source link

have any metric about jvm GC Pause? #931

Closed qhyuTT closed 7 months ago

qhyuTT commented 7 months ago

image

There is a blank area in my monitor, and it returns to normal after 1 minute.i guess it maybe caused by stop the world,but i can't find any metric about metric.

qhyuTT commented 7 months ago

version:jmx_prometheus_javaagent-0.19.0.jar

dhoard commented 7 months ago

@qhyuTT The exporter can only expose MBean attributes.

Looking at the GarbageCollectorMXBean (https://docs.oracle.com/javase/8/docs/api/java/lang/management/GarbageCollectorMXBean.html) I don't see any attributes that represent GC pause time.

There is an internal MBean, sun.management.HotspotRuntimeMBean that provides getTotalSafepointTime() to get the total JVM GC pause time but doesn't provide per GC pause time. Considering it's a sun. package, it may or may not work.

qhyuTT commented 7 months ago

yeah, Using internal APIs like sun.management.HotspotRuntimeMBean carries some risk as they might change in future Java versions. thans for for reply.