Subject: [prometheus-users] Any examples of configs for jmx_exporter for standard JVM beans?


Hi all,

Using JMX exporter and looking at config examples
<https://github.com/prometheus/jmx_exporter/tree/master/example_configs> I
am still having trouble with some rules. For example, with these rules:

rules:
  - pattern: 'java.lang:type=OperatingSystem,OpenFileDescriptorCount'
  - pattern: 'java.lang:type=OperatingSystem,SystemLoadAverage'
  - pattern: 'java.lang:type=OperatingSystem,SystemCPULoad'
  - pattern: 'java.lang:type=OperatingSystem,ProcessCPULoad'

I do get the FD count but not the rest. For memory usage, these work as I
wanted:

 - pattern: 'java.lang:type=Memory,HeapMemoryUsage<used=(\w)>'
   value: $1
 - pattern: 'java.lang:type=Memory,NonHeapMemoryUsage<used=(\w)>'
   value: $1
But I cannot figure out how to get garbage collection metrics (in
particular, say, I wanted
java_lang_GarbageCollector_LastGcInfo_duration{name="ParNew",} and
java_lang_GarbageCollector_CollectionTime ?

Thank you.

-g

--