Skip to content

hivemq/hivemq-aws-cloudwatch-extension

Repository files navigation

HiveMQ AWS CloudWatch Extension

Extension Type GitHub release (latest by date) GitHub GitHub Workflow Status

Purpose

This HiveMQ Extension allows HiveMQ to report its metrics to AWS CloudWatch.

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.

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.30 per custom metric (for the first 10 000 metrics)

  • $0.01 per 1000 GetMetricStatistics, ListMetrics, or PutMetricData requests

Installation

  • Download the extension from the HiveMQ Marketplace.

  • Copy the content of the zip file to the extensions folder of your HiveMQ nodes.

  • Modify the extension-config.xml file for your needs.

Extension Configuration

The CloudWatch extension uses its own configuration file 'extension-config.xml'.

extension-config.xml

The following properties are available:

Property Description

report-interval

A value in minutes which sets the reporting interval (defaults to 1 minute)

api-timeout

The api call and api attempt timeout in ms (if not set defaults to AWS SDK default)

metric enabled="{true/false}"

a metric name (from a list of metrics) which should be reported to CloudWatch

Example Configuration
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cloudwatch-extension-configuration>
    <report-interval>1</report-interval>
    <metrics>
        <metric>com.hivemq.messages.incoming.total.count</metric>
        <metric>com.hivemq.messages.outgoing.total.count</metric>
        <metric enabled="false">com.hivemq.messages.incoming.total.rate</metric>
    </metrics>
</cloudwatch-extension-configuration>

A list of all available metrics can be found on the HiveMQ Documentation here at HiveMQ Metrics

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.

Contributing

If you want to contribute to HiveMQ AWS CloudWatch Extension, see the contribution guidelines.

License

HiveMQ AWS CloudWatch Extension is licensed under the APACHE LICENSE, VERSION 2.0. A copy of the license can be found here.