HiveMQ Edge Monitoring

The ability to monitor server applications is very important for operating these applications. HiveMQ is no exception, in fact HiveMQ was designed to enable different kinds of monitoring easily. When using HiveMQ in critical infrastructure, we strongly recommended to enable monitoring and use a decent application for displaying the relevant information you need for your operations.

Gathering metrics is enabled by default. The HiveMQ metrics subsystem is designed to be very performant and no performance penalties are expected for monitoring relevant metrics, even in low-latency and high-throughput environments.

JMX

HiveMQ has extensive support for Java Management Extensions (JMX) to monitor internals of HiveMQ and the JVM. JMX is a proven industry standard for Java Monitoring and many external tools support JMX natively or via extensions.

HiveMQ Edge Monitoring Configuration

If you run HiveMQ behind a Network Address Translation (NAT) process, you must set some additional options:

JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<PUBLIC_IP>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=9010"

This allows you to connect via JConsole using PUBLIC_IP:9010.

MBeans

When JMX is activated, the following MBeans can be used for monitoring:

MBean Name Description

metrics

The HiveMQ metrics and statistics. A list of all available metrics is available here.

java.nio

Statistics and metrics about used native memory.

java.lang

All information about the Java Virtual Machine can be monitored here.

HiveMQ Edge Available Metrics

Metric Types

HiveMQ Edge provides five different types of metrics:

Table 1. Available metric types
Metric Type Description

Gauge

A gauge returns a simple value at the point of time the metric was requested.

Counter

A counter is a simple incrementing and decrementing number.

Histogram

A histogram measures the distribution of values in a stream of data. They allow to measure min, mean, max, standard deviation of values and quantiles.

Meter

A meter measures the rate at which a set of events occur. Meters measure mean, 1-, 5-, and 15-minute moving averages of events.

Timer

A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence. It captures rate and duration information.

The following table lists metrics that are available for monitoring HiveMQ Edge:

Table 2. HiveMQ Edge standard metrics
Metric Type Description

com.hivemq.edge.messages.dropped.count

Counter

Counts every dropped message

com.hivemq.edge.messages.incoming.connect.count

Counter

Counts every incoming MQTT CONNECT message

com.hivemq.edge.messages.incoming.publish.count

Counter

Counts every incoming MQTT PUBLISH message

com.hivemq.edge.messages.incoming.total.count

Counter

Counts every incoming MQTT message

com.hivemq.edge.messages.outgoing.publish.count

Counter

Counts every outgoing MQTT PUBLISH message

com.hivemq.edge.messages.outgoing.total.count

Counter

Counts every outgoing MQTT message

com.hivemq.edge.messages.retained.current

Gauge

The current amount of retained messages

com.hivemq.edge.messages.will.count.current

Counter

The current number of stored Last Will messages.

com.hivemq.edge.messages.will.published.count.total

Counter

The total number of published Last Will messages.

com.hivemq.edge.mqtt.connections.not-writable.current

Counter

Counts the number of MQTT client channels which are currently not writable

com.hivemq.edge.networking.bytes.read.total

Gauge

The total amount of read bytes

com.hivemq.edge.networking.bytes.write.total

Gauge

The total amount of written bytes

com.hivemq.edge.networking.connections.current

Gauge

The current number of active MQTT connections

com.hivemq.edge.networking.connections-closed.total.count

Counter

The total number of clients that disconnected gracefully and ungracefully from HiveMQ

com.hivemq.edge.sessions.overall.current

Gauge

Measures the current count of stored sessions. These sessions include all sessions, including online and offline clients

com.hivemq.edge.subscriptions.overall.current

Counter

Measures the current count of subscriptions on the broker

com.hivemq.edge.persistence.client-sessions.in-memory.total-size

Gauge

Measures the approximate memory usage of the client session persistence if the memory persistence is used

com.hivemq.edge.persistence.client-session.subscriptions.in-memory.total-size

Gauge

Measures the approximate memory usage of the subscription persistence if the memory persistence is used.

com.hivemq.edge.persistence.retained-messages.in-memory.total-size

Gauge

Measures the approximate memory usage of the retained message persistence if the memory persistence is used

com.hivemq.edge.persistence.payload.in-memory.total-size

Gauge

Measures the approximate memory usage of the payload persistence if the memory persistence is used

com.hivemq.edge.persistence.queued-messages.in-memory.total-size

Gauge

Measures the approximate memory usage of the queued message persistence if the memory persistence is used

com.hivemq.edge.license-till-expire

Counter

Time in days until the installed license expires

Monitoring via Extensions

HiveMQ Edge provides capabilities to extend functionality via the HiveMQ Extension SDK. There are extensions available that allow integration with third-party tools to export metrics into these systems.

For more information, see HiveMQ Platform Monitoring.