Report HiveMQ metrics to AWS with the HiveMQ AWS CloudWatch Extension
The HiveMQ team is pleased to announce the availability of the HiveMQ AWS CloudWatch Extension.
Monitoring a production MQTT broker system is very important to recognise problems in a timely manner and hopefully before these problems cause headaches for the production system. Amazon offers their own monitoring system AWS CloudWatch for applications running on the Amazon Web Services. HiveMQ is now able to integrate directly with AWS CloudWatch with the free off-the-shelf HiveMQ AWS CloudWatch Extension.
It is possible to send every HiveMQ metric to CloudWatch. Every metric which should be reported must be configured explicitly to reduce the costs, since CloudWatch can be expensive if you publish too much (unnecessary) data.
Once everything is set up the selected metrics are available in CloudWatch inside the instance’s region under the namespace ‘hivemq-metrics’.
Caution: AWS CloudWatch costs
AWS CloudWatch metrics can be very expensive. So please make sure you really want to report the specified metrics. You can find the full AWS pricing here.
At the time of writing the AWS prices are the following:
$0.30per custom metric (for the first 10 000 metrics)
$0.01per 1000 GetMetricStatistics, ListMetrics, or PutMetricData requests
- Download the extension from the HiveMQ Website or our GitHub Releases Page.
- Copy the content of the zip file to the
extensionsfolder of your HiveMQ nodes.
- Modify the
extension-config.xmlfile for your needs.
The CloudWatch extension can be configured inside the ’extension-config.xml’ file.
The following properties are available:
|A value in minutes which sets the reporting interval (defaults to 1 minute)
|The api call and api attempt timeout in ms. (If not set defaults to AWS SDK default)
|a metric name (from a list of metrics) which should be reported to CloudWatch
A list of all available metrics can be found on the HiveMQ Documentation here at HiveMQ Metrics
AWS CloudWatch Configuration
The extension needs permission to be able to publish metrics to AWS CloudWatch. Simply create an AWS IAM Role with a custom Policy that grants the CloudWatch:PutMetricData Permission and apply it to the HiveMQ instance.
If you need assistance, we are happy to help. The best place to get in contact is our Support.