HiveMQ Monitoring: The built-in integration with a hosted Graphite Service

Written by The HiveMQ Team

Category: HiveMQ Third Party

Published: October 2, 2013


As we have seen in one of our last posts, monitoring of production systems is very important to build reliable services and to react quickly to unforseen events. HiveMQ has a built-in integration for the awesome Graphite monitoring and graphing tool.

In previous versions HiveMQ worked seamlessly with any given Graphite server installation, which allows any metrics name you chose. Some hosted Graphite solutions like HostedGraphite need an API Key as a special prefix for your actual metrics to work, though.

That means a metric like ActiveClients would become API_KEY.ActiveClients.

In previous HiveMQ versions this was hard to achieve with the built-in Graphite integration. Since HiveMQ 1.4.1. it’s possible to add any prefix you like to your actual metrics. You can prefix API-Keys or use different prefixes for different HiveMQ cluster nodes to distinguish the HiveMQ instances when monitoring.

If you are evaluating HiveMQ as your MQTT broker of choice, you may find it useful to use a hosted Graphite solution to test the monitoring capabilities of HiveMQ instead of setting up your own Graphite server. We had very good results with HostedGraphite which you can test for free for 15 days.

Set up an hosted Graphite account

  1. Go to http://www.hostedgraphite.com and register your account.
  2. Copy your API Key

That was pretty much it on the hosted Graphite side.

Configuring HiveMQ

Set the following properties:

1
2
3
4
graphite.enabled=true
graphite.interval=180
graphite.url=carbon.hostedgraphite.com:2003
graphite.metricPrefix=YOUR_API_KEY

Be sure to set the API Key as the graphite.metricPrefix.

Now start HiveMQ and you should see that HiveMQ publishes the metrics to the hosted Graphite instance. You can now create dashboards on your Graphite instance and play around with the statistics published by HiveMQ. Please note, that it could take a few minutes until the first metrics appear in your Graphite installation.

Now be sure to set up your Collectl instance on your HiveMQ server to ensure you can measure what’s going on (in terms of CPU usage / memory usage/ IO / etc) on your server instance.

Conclusion

We have seen that it’s a matter of minutes to set up the monitoring for HiveMQ with the help of a hosted Graphite instance. This is especially useful when you can’t or don’t want to host your own Graphite installation. Monitoring is a critical part of operating any server software. No excuses, monitor your HiveMQ instances today with your own Graphite installation or with a hosted one. :-)

About The HiveMQ Team

We love writing about MQTT, IoT protocols and architecture in general. Our experts are here to help, so reach out to us if we can help!
Contact us
HiveMQ - File Authentication Plugin - Available on GitHub
MQTT Web Applications: How to build your own!