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

difference between metrics in jmx exporter #915

Open acharbha opened 9 months ago

acharbha commented 9 months ago

my /opt/activemq/conf/jmxexporter.yml is configured to enable all metrics - echo 'rules:

I would like to understand the difference between these 2 metrics, are they same if so why there's a difference and if they are different why do we say same name java heap memory ? Can someone please help me understand this ?

# HELP jvm_memory_bytes_used Used bytes of a given JVM memory area.
# TYPE jvm_memory_bytes_used gauge
jvm_memory_bytes_used{area="heap",} 5.694892E7

# HELP java_lang_Memory_HeapMemoryUsage_used java.lang.management.MemoryUsage java.lang:name=null,type=Memory,attribute=used
# TYPE java_lang_Memory_HeapMemoryUsage_used untyped
java_lang_Memory_HeapMemoryUsage_used 6.21918E7
dhoard commented 7 months ago

The metrics use the same Java MBean java.lang:type=MemoryPool but collect the value at different times. If the heap usage changes between calls to the MBean, you will have different values.