The HiveMQ InfluxDB Extension can be leveraged to gather metrics from HiveMQ and persist them into a time series database. This database can be used as the data source for a monitoring dashboard (like Grafana) that drills down into the inner workings of HiveMQ and provides valuable insights to your operations team.
Installing the extension for HiveMQ is very easy:
-
Download the extension from the HiveMQ website and unzip the downloaded zip file.
-
In the folder
hivemq-influxdb-extension
, modify theinfluxdb.properties
file to fit your needs. Check that the mandatory properties (host, port) are set -
Copy the folder
hivemq-influxdb-extension
to your<HIVEMQ_HOME>/extensions
folder -
Done
The InfluxDB Monitoring extension uses its own configuration file influxdb.properties
.
The extension won’t start if this file is missing or the required properties are not set.
Config name | Required | Description | Default |
---|---|---|---|
mode |
no |
The mode configured for the InfluxDB sender. Possibilities are: http, tcp, udp, cloud |
http |
host |
yes |
The host name of the InfluxDB instance. |
- |
port |
yes |
The port number the InfluxDB instance is listening. |
8086 |
protocol |
no |
The protocol the InfluxDB sender uses in http mode. |
http (or https for cloud mode) |
auth |
no |
The authorization string to be used to connect to InfluxDB, of format username:password. If mode "cloud" is used, the token must be passed here |
- |
prefix |
no |
The measurement prefix. |
- |
database |
no |
The database name. |
hivemq |
reportingInterval |
no |
The reporting interval in seconds. |
1 |
connectTimeout |
no |
The connect and read timeout in seconds. |
5000 |
tags |
no |
The tags for each metric.
Listed as a semicolon ( |
- |
organization |
only for mode: "cloud" |
The organization to push data to |
- |
bucket |
only for mode: "cloud" |
The bucket to push data to |
- |
Note
|
When using InfluxDB 2 the Cloud mode should be configured. |
mode:http
host:localhost
port:8086
protocol:http
auth:
prefix:
database:hivemq
reportingInterval:1
connectTimeout:5000
tags:host=hivemq1
If you don’t already have an InfluxDB instance set up, here is an instruction how to start a not configured InfluxDB instance with Docker.
-
Download and install Docker for your platform
-
Start an InfluxDB docker container with the command
docker run -p 8086:8086 -v $PWD:/var/lib/influxdb influxdb
. For more information about using InfluxDB with Docker visit the official Docker repository for InfluxDB -
A local instance of InfluxDB should be running with the port for the database set to 8086
-
Create a database that matches the name set in the property
database
ininfluxdb.properties
. For the defaultdatabase
value use the commandcurl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE hivemq"
-
Done
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 InfluxDB Extension, see the contribution guidelines.
HiveMQ InfluxDB Extension is licensed under the APACHE LICENSE, VERSION 2.0
.
A copy of the license can be found here.