-
Notifications
You must be signed in to change notification settings - Fork 265
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, it is 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.
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.
If your HiveMQ runs behind some kind of NAT you have to 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.
When JMX is activated, the following MBeans can be used for monitoring:
MBean Name | Description |
---|---|
|
The HiveMQ metrics and statistics. A list of all available metrics is available here. |
|
Statistics and metrics about used native memory. |
|
All information about the Java Virtual Machine can be monitored here. |
There are five different types of Metrics available. The following table shows all available metric types:
Metric Type | Description |
---|---|
|
A gauge returns a simple value at the point of time the metric was requested. |
|
A counter is a simple incrementing and decrementing number. |
|
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. |
|
A meter measures the rate at which a set of events occur. Meters measure mean, 1-, 5-, and 15-minute moving averages of events. |
|
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 CE:
Metric | Type | Description |
---|---|---|
com.hivemq.messages.dropped.count |
|
Counts every dropped message. |
com.hivemq.messages.incoming.connect.count |
|
Counts every incoming MQTT CONNECT message |
com.hivemq.messages.incoming.publish.count |
|
Counts every incoming MQTT PUBLISH message |
com.hivemq.messages.incoming.total.count |
|
Counts every incoming MQTT message |
com.hivemq.messages.outgoing.publish.count |
|
Counts every outgoing MQTT PUBLISH message |
com.hivemq.messages.outgoing.total.count |
|
Counts every outgoing MQTT message |
com.hivemq.messages.retained.current |
|
The current amount of retained messages |
com.hivemq.mqtt.connections.not-writable.current |
|
Counts the number of MQTT client channels which are currently not writable |
com.hivemq.networking.bytes.read.total |
|
The total amount of read bytes |
com.hivemq.networking.bytes.write.total |
|
Total amount of written bytes |
com.hivemq.networking.connections.current |
|
The current total number of active MQTT connections |
com.hivemq.networking.connections-closed.total.count |
|
Counts all clients which disconnected from HiveMQ (= graceful + ungraceful) |
com.hivemq.sessions.overall.current |
|
Measures the current count of stored sessions. These sessions include all sessions, including online and offline clients |
com.hivemq.subscriptions.overall.current |
|
Measures the current count of subscriptions on the broker |
com.hivemq.persistence.client-sessions.in-memory.total-size |
|
Measures the approximate memory usage of the client session persistence if the memory persistence is used |
com.hivemq.persistence.client-session.subscriptions.in-memory.total-size |
|
Measures measures the approximate memory usage of the subscription persistence if the memory persistence is used. |
com.hivemq.persistence.retained-messages.in-memory.total-size |
|
Measures measures the approximate memory usage of the retained message persistence if the memory persistence is used |
com.hivemq.persistence.payload.in-memory.total-size |
|
Measures the approximate memory usage of the payload persistence if the memory persistence is used |
com.hivemq.persistence.queued-messages.in-memory.total-size |
|
Measures the approximate memory usage of the queued message persistence if the memory persistence is used |