prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example config for Tomcat

danlz opened this issue · comments

https://github.com/prometheus/jmx_exporter/blob/main/example_configs/tomcat.yml

You have to add a rule for exporting the java_lang_operatingsystem_* properties, ie:

 - pattern: 'java.lang<type=OperatingSystem><>(.*):'
   name: java_lang_operatingsystem_$1
   type: COUNTER

@danlz Can you provide usage context? Are you using the exporter in agent mode or standalone mode?

I'm using it in agent mode.
You are including the java.lang:type=OperatingSystem MBean, but not exposing any of its attributes.

@danlz the issue with adding an OperatingSystem MBean rule is that it's only valid in agent mode. In standalone mode, the OperatingSystem MBean would refer to the standalone exporter's JVM which would produce misleading metrics.

I'm inclined to remove "java.lang:type=OperatingSystem" from the whitelistObjectNames configuration.

Thoughts?

ok, the config will be consistent.