# Metrics

EMQX Broker provides users with metrics monitoring functions, allowing users and operation and maintenance personnel to know the current service status based on these metrics. The metrics monitoring function is forcibly enabled. This function has high performance, and users do not need to worry about affecting system performance in high-throughput scenarios.

EMQX Broker provides users with multiple ways to view metrics and status. Most directly, users can see this data on the Overview page of EMQX Dashboard.

If it is not convenient to access the Dashboard, they can also obtain these data through HTTP API and system topic messages. For specific operations, see HTTP API and $SYS system topic.


EMQX Broker provides the emqx_statsd (opens new window) plug-in, which is used to output the system's monitoring data to a third-party monitoring system. You can refer to Prometheus Monitoring Alarm for an example.

# Metrics & Stats

EMQX Broker divides metrics into Metrics and Stats. Metrics usually refer to data that will only increase monotonically, such as the number of sent bytes and the number of sent messages. Metrics currently provided by EMQX Broker covers the four dimensions of bytes, packets, messages, and events. Stats usually refers to data that appears in pairs, including current values and historical maximums, such as the current number of subscriptions and the historical maximum number of subscription.

# Metrics

# Byte

NameData TypeDescription
bytes.receivedIntegerNumber of received bytes
bytes.sentIntegerNumber of send bytes

# Packet

NameData TypeDescription
packets.receivedIntegerNumber of received packets
packets.sentIntegerNumber of sent packets
packets.connect.receivedIntegerNumber of received CONNECT packets
packets.connack.auth_errorIntegerNumber of sent CONNACK messages with reason codes 0x86 and 0x87
packets.connack.errorIntegerNumber of sent CONNACK packets where reason code is not 0x00. The value of this indicator is greater than or equal to the value of packets.connack.auth_error
packets.connack.sentIntegerNumber of sent CONNACK packets
packets.publish.receivedIntegerNumber of received PUBLISH packets
packets.publish.sentIntegerNumber of sent PUBLISH packets
packets.publish.inuseIntegerNumber of received PUBLISH packets with occupied packet identifiers
packets.publish.auth_errorIntegerNumber of received PUBLISH packets that failed the ACL check
packets.publish.errorIntegerNumber of received PUBLISH packets that cannot be published
packets.publish.droppedIntegerNumber of PUBLISH packets that were discarded due to the receiving limit
packets.puback.receivedIntegerNumber of received PUBACK packets
packets.puback.sentIntegerNumber of sent PUBACK packets
packets.puback.inuseIntegerNumber of received PUBACK messages with occupied identifiers
packets.puback.missedIntegerNumber of received PUBACK packets with unknown identifiers
packets.pubrec.receivedIntegerNumber of received PUBREC packets
packets.pubrec.sentIntegerNumber of sent PUBREC packets
packets.pubrec.inuseIntegerNumber of received PUBREC messages with occupied identifiers
packets.pubrec.missedIntegerNumber of received PUBREC packets with unknown identifiers
packets.pubrel.receivedIntegerNumber of received PUBREL packets
packets.pubrel.sentIntegerNumber of sent PUBREL packets
packets.pubrel.missedIntegerNumber of received PUBREL packets with unknown identifiers
packets.pubcomp.receivedIntegerNumber of received PUBCOMP packets
packets.pubcomp.sentIntegerNumber of sent PUBCOMP packets
packets.pubcomp.inuseIntegerNumber of received PUBCOMP messages with occupied identifiers
packets.pubcomp.missedIntegerNumber of missed PUBCOMP packets
packets.subscribe.receivedIntegerNumber of received SUBSCRIBE packets
packets.subscribe.errorIntegerNumber of received SUBSCRIBE packets with failed subscriptions
packets.subscribe.auth_errorIntegerNumber of received SUBACK packets that failed the ACL check
packets.suback.sentIntegerNumber of sent SUBACK packets
packets.unsubscribe.receivedIntegerNumber of received UNSUBSCRIBE packets
packets.unsubscribe.errorIntegerNumber of received UNSUBSCRIBE packets with failed unsubscriptions
packets.unsuback.sentIntegerNumber of sent UNSUBACK packets
packets.pingreq.receivedIntegerNumber of received PINGREQ packets
packets.pingresp.sentIntegerNumber of sent PUBRESP packets
packets.disconnect.receivedIntegerNumber of received DISCONNECT packets
packets.disconnect.sentIntegerNumber of sent DISCONNECT packets
packets.auth.receivedIntegerNumber of received AUTH packets
packets.auth.sentIntegerNumber of sent AUTH packets

# Message (PUBLISH packet)

NameData TypeDescription
delivery.dropped.too_largeIntegerThe number of messages that were dropped because the length exceeded the limit when sending
delivery.dropped.queue_fullIntegerNumber of messages with a non-zero QoS that were dropped because the message queue was full when sending
delivery.dropped.qos0_msgIntegerNumber of messages with QoS of 0 that were dropped because the message queue was full when sending
delivery.dropped.expiredIntegerNumber of messages that were dropped due to message expiration when sending
delivery.dropped.no_localIntegerNumber of messages that were dropped due to the No Local subscription option when sending
delivery.droppedIntegerTotal number of messages that were dropped when sent
messages.delayedIntegerNumber of delay-published messages stored by EMQX Broker
messages.deliveredIntegerNumber of messages forwarded to the subscription process internally by EMQX Broker
messages.droppedIntegerTotal number of messages dropped by EMQX Broker before forwarding to the subscription process
messages.dropped.expiredIntegerNumber of messages that were dropped due to message expiration when receiving
messages.dropped.no_subscribersIntegerNumber of messages dropped due to no subscribers
messages.forwardIntegerNumber of messages forwarded to other nodes
messages.publishIntegerNumber of messages published in addition to system messages
messages.qos0.receivedIntegerNumber of QoS 0 messages received from clients
messages.qos2.receivedIntegerNumber of QoS 1 messages received from clients
messages.qos1.receivedIntegerNumber of QoS 2 messages received from clients
messages.qos0.sentIntegerNumber of QoS 0 messages sent to clients
messages.qos1.sentIntegerNumber of QoS 1 messages sent to clients
messages.qos2.sentIntegerNumber of QoS 2 messages sent to clients
messages.receivedIntegerNumber of messages received from the client, which is equal to the sum of messages.qos0.received,messages.qos1.received, and messages.qos2.received
messages.sentIntegerThe number of messages sent to the client, which is equal to the sum of messages.qos0.sent,messages.qos1.sent, and messages.qos2.sent
messages.retainedIntegerNumber of retained messages stored by EMQX Broker
messages.ackedIntegerNumber of acked messages

# Event

NameData TypeDescription
client.auth.anonymousIntegerThe number of client's final anonymous login
client.connectIntegerclient.connect hook trigger times
client.authenticateIntegerclient.authenticate hook trigger times
client.connackIntegerclient.connack hook trigger times
client.connectedIntegerclient.connected hook trigger times
client.disconnectedIntegerclient.disconnected hook trigger times
client.check_aclIntegerclient.check_acl hook trigger times
client.subscribeIntegerclient.subscribe hook trigger times
client.unsubscribeIntegerclient.unsubscribe hook trigger times
client.auth.successIntegerNumber of successful client authentications
client.auth.success.anonymousIntegerNumber of successful anonymous authentication
client.auth.failureIntegerNumber of client authentication failures
client.acl.allowIntegerNumber of client ACL verification passes
client.acl.denyIntegerNumber of client ACL verification failures
client.acl.cache_hitIntegerNumber of client ACL verification cache hits
session.createdIntegersession.created hook trigger times
session.discardedIntegersession.discarded hook trigger times
session.resumedIntegersession.resumed hook trigger times
session.takeoveredIntegersession.takeovered hook trigger times
session.terminatedIntegersession.terminated hook trigger times

# Stats

NameData TypeDescription
connections.countIntegerCurrent connections
connections.maxIntegerHistorical maximum number of connections
sessions.countIntegerNumber of current sessions
sessions.maxIntegerHistorical maximum number of sessions
topics.countIntegerNumber of current topics
topics.maxIntegerHistorical maximum number of topics
subscribers.countIntegerNumber of current subscribers
subscribers.maxIntegerHistorical maximum number of subscribers
subscriptions.countIntegerNumber of current subscriptions, including shared subscriptions
subscriptions.maxIntegerHistorical maximum number of subscriptions
subscriptions.shared.countIntegerNumber of current shared subscriptions
subscriptions.shared.maxIntegerHistorical maximum number of shared subscriptions
routes.countIntegerNumber of current routes
routes.maxIntegerHistorical maximum number of routes
retained.countIntegerNumber of currently retained messages
retained.maxIntegerHistorical maximum number of retained messages