This is a metrics plugin implementation for the ActiveMQ Artemis message broker. It provides integration with Prometheus using two modules:
-
artemis-prometheus-metrics-plugin Provides the actual implementation of
org.apache.activemq.artemis.core.server.metrics.ActiveMQMetricsPluginand packages it with the micrometer and Prometheus dependencies in an "uber" jar. -
artemis-prometheus-metrics-plugin-servlet Provides a war file containing a simple servlet which can be deployed to the broker's embedded web server which then Prometheus can use to scrape metrics.
Simply run mvn install. This command will build both modules and the output
will be in their respective target directories. JDK 11 or higher is required.
After building the artifacts follow these steps:
-
Copy
artemis-prometheus-metrics-plugin/target/artemis-prometheus-metrics-plugin-<VERSION>.jarto<ARTEMIS_INSTANCE>/lib. -
Add this to your
<ARTEMIS_INSTANCE>/etc/broker.xml:<metrics><plugin class-name="com.redhat.amq.broker.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"/></metrics> -
Create the directory
<ARTEMIS_INSTANCE>/web. -
Copy
artemis-prometheus-metrics-plugin-servlet/target/metrics.warto<ARTEMIS_INSTANCE>/web. -
Add this to the
webelement in<ARTEMIS_INSTANCE>/etc/bootstrap.xml:<app url="metrics" war="metrics.war"/>