HiveMQ Cloud Metrics
The metrics HiveMQ exposes for your HiveMQ Cloud cluster vary based on your HiveMQ Cloud plan.
Metrics Overview
Each HiveMQ Cloud plan provides a different level of monitoring:
-
Starter: Access to essential metrics for basic monitoring and troubleshooting.
-
Enterprise: Comprehensive metrics including all Starter metrics plus advanced monitoring capabilities
HiveMQ Cloud Starter Metrics
Clusters on the HiveMQ Cloud Starter plan provide the following metrics:
| Metric | Type | Description |
|---|---|---|
|
|
Counts every closed connection that was closed because the client missed sending a PINGREQ message during the keep-alive interval |
|
|
The current number of queued messages for client sessions |
|
|
The current number of pending QoS 0 messages for client sessions |
|
|
The total number of pending messages for client sessions |
|
|
The number of PUBLISH messages that dropped because the message queue for a consumer topic was full |
|
|
The total number of dropped messages on the broker |
|
|
The number of PUBLISH messages that dropped because a Publish Inbound Interceptor prevented onward delivery |
|
|
The number of PUBLISH messages that dropped because of an internal error |
|
|
The number of PUBLISH messages that dropped because the message size was too large for the client |
|
|
The number of MQTT messages (excluding PUBLISH packets) that dropped because the message size was too large for the client |
|
|
The number of PUBLISH messages that dropped because the socket for the client was not writable (QoS 0 only) |
|
|
The number of PUBLISH messages that dropped because the global memory limit for QoS 0 messages was exceeded |
|
|
The number of PUBLISH messages that dropped because the message queue for a disconnected persistent session client was full |
|
|
The number of PUBLISH messages that are dropped because the message queue for a shared subscription is full |
|
|
The total number of expired messages on the broker |
|
|
Counts every incoming MQTT CONNECT message |
|
|
Counts every incoming MQTT PUBLISH message |
|
|
Counts every outgoing MQTT PUBLISH message |
|
|
The current total number of active MQTT connections |
|
|
Total number of normalized messages |
|
|
Counts the amount of publish messages received, without any matching subscribers |
|
|
The current number of active persistent sessions (= Online MQTT clients which are connected with cleanSession=false) |
|
|
The current number of subscriptions on the broker |
|
|
The number of connected clients to which at least one non-terminated behavior is currently applied |
|
|
The total number of failed terminations of behaviors |
|
|
The total number of successful terminations of behaviors |
|
|
The total number of failed schema deserializations in behavior policies |
|
|
The total number of successful schema deserializations in behavior policies |
|
|
The total number of behavior states initialized for all clients |
|
|
The number of PUBLISH messages that are dropped because a policy prevented onward delivery |
|
|
The total number of payloads that failed to validate successfully |
|
|
The total number of payloads that validated successfully |
|
|
The total number of policies that had a failed outcome |
|
|
The total number of policies that had a successful outcome |
|
|
The total number of failed schema validations |
|
|
The total number of successful schema validations |
|
|
The total number of validators that had a failed outcome |
|
|
The total number of validators that had a successful outcome |
|
|
The current number of loaded scripts in the script engine |
|
|
The current number of shared subscriptions on the broker |
|
|
The total number of records the extension cannot produce to Kafka |
|
|
The total number of records the extension ignored |
|
|
The total number of records that were retried to be produced to Kafka |
|
|
The total number of records the extension attempted to send to Kafka |
|
|
The total number of records the extension successfully produced to Kafka |
|
|
The total number of messages the extension drops from MQTT to Google Cloud Pub/Sub |
|
|
The total number of MQTT to Google Cloud Pub/Sub messages the extension cannot successfully forward |
|
|
The total number of MQTT to Google Cloud Pub/Sub messages the extension ignores |
|
|
The total number of MQTT to Google Cloud Pub/Sub messages the extension resends |
|
|
The total number of MQTT to Google Cloud Pub/Sub messages the extension sends |
|
|
The total number of MQTT to Google Cloud Pub/Sub messages from all transformers and mappings that the extension successfully forwards |
HiveMQ Cloud Enterprise Metrics
In addition to all Starter metrics, HiveMQ Cloud Enterprise offers the following advanced monitoring metrics:
Additional HiveMQ Cloud Enterprise Metrics
| Metric | Type | Description |
|---|---|---|
|
|
Counts every incoming MQTT 3 CONNECT message |
|
|
Counts every incoming MQTT 5 CONNECT message |
|
|
Counts every incoming MQTT PUBLISH message that is sent with quality of service (QoS) level 0 |
|
|
Counts every incoming MQTT PUBLISH message that is sent with quality of service (QoS) level 1 |
|
|
Counts every incoming MQTT PUBLISH message that is sent with quality of service (QoS) level 2 |
|
|
Counts every outgoing MQTT PUBLISH message that is sent with quality of service (QoS) level 0 |
|
|
Counts every outgoing MQTT PUBLISH message that is sent with quality of service (QoS) level 1 |
|
|
Counts every outgoing MQTT PUBLISH message that is sent with quality of service (QoS) level 2 |
|
|
The current number of queued messages |
|
|
The current (last 5 seconds) amount of read bytes |
|
|
The current (last 5 seconds) amount of written bytes |
HiveMQ Cloud Enterprise Dead Messages Queue Metrics
| Metric | Type | Description |
|---|---|---|
|
|
The total number of dead messages the broker detects |
|
|
The number of dead messages that are queued to a dead topic |
|
|
The number of dead messages that are dead more than once |
|
|
The number of dead messages that are dropped |
|
|
The number of dead messages that are expired |
HiveMQ Cloud Enterprise Dropped Messages Topic Metrics
| Metric | Type | Description |
|---|---|---|
|
|
The number of messages that are dead |
|
|
The number of messages that dropped due to queue limits |
|
|
The number of messages that originate from clients |
|
|
The number of messages that originate from shared subscriptions |
|
|
The number messages that originate from consumers |
|
|
The number of messages that are enqueued for a topic |
HiveMQ Cloud Enterprise Expired Messages Topic Metrics
| Metric | Type | Description |
|---|---|---|
|
|
The number of expired messages that are dead |
|
|
The number of expired messages that are dropped due to queue limits |
|
|
The number of expired messages that expire more than once |
|
|
The number of expired messages that are enqueued for an expired topic |
HiveMQ Cloud Enterprise Data Hub Metrics
| Metric | Type | Description |
|---|---|---|
|
|
The current number of policy entries in the behavior policy persistence |
|
|
The total number of state transitions behaviors perform |
|
|
The current number of data policy entries in the persistence |
|
|
The current amount of schema entries in the persistence |
|
|
The current number of script entries in the persistence |
HiveMQ Cloud OpenAPI Reference
For a detailed API reference, see: OpenAPI
Access HiveMQ Broker Metrics from a Remote Service
To access the metrics, you need an API token for your HiveMQ Cloud broker. For the token properties, see HiveMQ Cloud REST API Authorization Tokens.
Generate an API Token
The HiveMQ Platform lists API tokens on the API Keys tab. In this documentation, "API token" and "API key" refer to the same credential.
-
Log in to the HiveMQ Platform at app.hivemq.com.
-
Go to Connect > Connect & Manage Network, and select your HiveMQ Cloud broker.
-
On the broker details page, switch to the API Keys tab, and click Generate Key.
-
On the New API Key page, enter a unique name for the token in the Token name field. The name must start with a letter and contain 2 to 16 alphanumeric characters (a-z, A-Z, and 0-9).
-
In the Lifetime field, select how long the token is valid.
-
In the Access Type field, select Custom.
-
Under Custom permissions, select the Read permission in the Cluster category and the Otel metrics permission in the Metrics category.
-
To generate the token, click Create API token.
-
On the API Keys tab, click the copy icon next to the new token, and save the value in a secure location.
| You can view the token value only once. After you leave the page, you cannot copy the token again. |
Make an API Call
-
Copy the following command:
curl -v https://${YOUR_REST_API_BASE_URL}/metrics -H "Authorization: Bearer ${TOKEN}" -
Replace
https://${YOUR_REST_API_BASE_URL}with the REST API base URL of your broker. -
Replace
${TOKEN}with the API token that you generated. -
Run the command.
The command returns the current metrics from the broker.
Integrating HiveMQ Broker Metrics into Prometheus
To collect and monitor HiveMQ Cloud metrics in Prometheus, follow these steps:
-
Edit your Prometheus configuration (
prometheus.yml) -
Add the following scrape job:
scrape_configs:
- job_name: 'hivemq'
metrics_path: '${PATH_TO_METRICS_ENDPOINT}/metrics'
scheme: https
static_configs:
- targets:
- '${YOUR_REST_API_URL}'
bearer_token: '${TOKEN}'
Here is an example configuration:
scrape_configs:
- job_name: 'hivemq'
metrics_path: '/api/v2/orgs/rngipm/clusters/551f55b3-3026-420c-8908-95e958905055/metrics'
scheme: https
static_configs:
- targets:
- 'api.a01.euc1.aws.hivemq.cloud'
bearer_token: 'eyJ...'
${PATH_TO_METRICS_ENDPOINT} is part of the REST API BASE URL provided on the API Keys tab of your HiveMQ Cloud broker.
${YOUR_REST_API_URL} is also provided on the API Keys tab of your HiveMQ Cloud broker.