The Prometheus Monitoring extension allows HiveMQ to expose metrics to a Prometheus application.
-
Unzip the file:
hivemq-prometheus-extension-<version>-distribution.zip
to the directory:<HIVEMQ_HOME>/extensions
-
A configuration file
prometheusConfiguration.properties
can be found in thehivemq-prometheus-extension
folder. The properties are preconfigured with standard settings and can be adapted to your needs (The meaning of the fields is explained below). -
Start HiveMQ.
The extension can be configured with the prometheusConfiguration.properties
file, which is part of the hivemq-prometheus-extension
folder.
Name | Default | Description |
---|---|---|
|
9399 |
The port which the servlet will listen to. |
|
0.0.0.0 |
The bind-address which the servlet will listen to. |
|
/metrics |
The path for the service which gets called by Prometheus. It must start with a slash. |
You can test your configuration by navigating to <ip>:<port><metric_path>
(as configured in prometheusConfiguration.properties
) in your browser.
For example the address would be http://localhost:9399/metrics with default values.
You should see data provided by the extension:
# HELP com_hivemq_messages_incoming_publish_rate_total Generated from Dropwizard metric import (metric=com.hivemq.messages.incoming.publish.rate, type=com.codahale.metrics.Meter) # TYPE com_hivemq_messages_incoming_publish_rate_total counter com_hivemq_messages_incoming_publish_rate_total 0.0 ...
-
Load and install Prometheus
-
Configure Prometheus to scrape from <ip>:<port><metricPath> as configured in the prometheusConfiguration.properties.
-
Look at the website provided by your Prometheus application. You should be able to find the HiveMQ metrics.
For detailed information please visit: https://prometheus.io/docs/operating/configuration/
To enable Prometheus to gather metrics from HiveMQ, you need to add a scrape configuration to your Prometheus configuration. The following is a minimal example using the default values of the extension:
global: scrape_interval: 15s scrape_configs: - job_name: 'hivemq' scrape_interval: 5s metrics_path: '/metrics' static_configs: - targets: ['localhost:9399']
If you encounter any problems, we are happy to help. The best place to get in contact is our support.
If you want to contribute to HiveMQ Prometheus Extension, see the contribution guidelines.
HiveMQ Prometheus Extension is licensed under the APACHE LICENSE, VERSION 2.0
.
A copy of the license can be found here.