Client Event History

HiveMQ deployments can handle millions of clients with massive amounts of data. This level of activity can make it difficult to troubleshoot a single client. HiveMQ 4.4 introduces a new Client Event History feature that adds fine-grained, per-client observability to the HiveMQ Control Center and provides a historical view of client events. The event history makes it easier to understand what happened with a single client and helps you diagnose problems, even at a later time. Integration into our HiveMQ enterprise extension SDK allows you to trigger actions based on the events or export the historical data to analyze in a third party tool.

When you enable the Client Event History feature. HiveMQ automatically stores the following events for every MQTT client that connects to your HiveMQ cluster:

  • Client connect

  • Client disconnect

  • Overload protection activated

  • Overload protection deactivated

The event history for each client can be viewed in the Client Detail View of the HiveMQ Control Center:

Client Event History

Configuration

You can enable and disable the Client Event History and adjust the length of time HiveMQ stores event information to fit your individual use case.

Event History is a HiveMQ 4.4.x feature and requires Glibc version 2.12 or higher.
Table 1. Client Event History Configuration Settings
Configuration Default Limits Description

enabled

false

-

Defines whether the client event history feature is enabled. To enable the feature, set to true.

lifetime

604800

1-864000

The period of time in seconds that HiveMQ stores events for each client. The minimum legnth of time that HiveMQ can store events is one second, the maximum event storage lifetime is 864,000 seconds (10 days). By default, HiveMQ stores information for each event 604,800 seconds (one week) when Client Event History is enabled.

Example enabled Client Event History configuration
<?xml version="1.0"?>
<hivemq>
    ...
	<client-event-history>
		<enabled>true</enabled>
		<lifetime>604800</lifetime> <!-- 7 days -->
	</client-event-history>
    ...
</hivemq>
Use of the Client Event History feature can require increased storage capacity in your deployment. Before you enable this feature in production, we recommend that you consult with your HiveMQ support representative.

Client Event Monitoring

To increase observability, establish an event history, and provide insights into the activity of individual clients, HiveMQ offers the following client-event metrics:

Table 2. Client Event Metrics
Metric Type Description

com.hivemq.client-events.stored.total

Counter

The total number of client events HiveMQ currently stores including all replicas

com.hivemq.persistence.executor.client-events.tasks

Gauge

The current number of disk I/O tasks in the queue of the client-events persistence executor

com.hivemq.persistence.executor.client-events.time

Timer

The mean execution time in nanoseconds HiveMQ currently requires to process client event tasks