How to monitor JBoss EAP with Prometheus jmx-exporter

9.4k Views Asked by At

I want to monitor some JBoss EAP 7 servers with Prometheus/Grafana (as well as some Wildfly).

I understand I have to use jmx_exporter.

Should I use it as embedded (agent) or side-car (http)?

Which configuration file?

2

There are 2 best solutions below

2
On

It's recommended to use jmx-exporter embedded in the Java JVM virtual machine (use -javaagent). That's easier, more robust and gives better insights.

The configuration file depends on the version (JBoss use undertow... that's a different mBeans to collect than JBoss 6).

The jmx-exporter project provides an example configuration file for WildFly 10 example_configs/wildfly-10.yaml.

However, if you use "JBoss EAP for Openshift" containers images, the jmx-exporter agent is already embedded in the containers (set variables: AB_PROMETHEUS_ENABLE=true and sometimes this one too JAVA_OPTS_APPEND=-Dwildfly.statistics-enabled=true)

If you don't use Red Hat's container images, you can still use the ssame jmx-exporter configuration files. Those files (jmx-exporter-config.yaml) are open-source and available on github:

1
On

I was able to scrape the metrices using this config

Add the below config to your startup script or standalone.conf

JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.3.Final-redhat-1.jar"
JAVA_OPTS="$JAVA_OPTS -javaagent:/path/to/exporter/jmx_exporter.jar=10001:/path/to/config/config.yaml"