How to enable Prometheus and statistics in EAP for OpenShift?

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform
  • Red Hat Enterprise Application Platform (EAP) / JBoss EAP for OpenShift
    • 8
    • 7.1+
      • jboss-eap71-openshift:1.4, jboss-eap72-openshift:1.0 or later

Issue

  • How to enable Prometheus and statistics in EAP for OpenShift?
  • Enabled prometheus but statistics is not enabled in EAP for OpenShift

Resolution

EAP Prometheus endpoint can be enabled by using AB_PROMETHEUS_ENABLE environment variable and enable EAP statistics via wildfly.statistics-enabled system property.

$ oc set env dc/$DC_NAME AB_PROMETHEUS_ENABLE=true
$ oc set env dc/$DC_NAME JAVA_OPTS_APPEND=-Dwildfly.statistics-enabled=true

For more details on the prometheus agent and test see solution EAP 7 image jmx-exporter agent.

Components
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.