Skip to content

Metrics API

This API documentation provides operations related to view statistical metrics for the deployment.

View Statistical Metrics

URI

GET /metrics

Request Message

None.

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsList of statistical metrics on each node
data[0].nodeStringNode name
data[0].metricsObjectMonitoring metrics data, see metrics below

Metrics:

NameTypeDescription
actions.failureIntegerNumber of failure executions of the action
actions.successIntegerNumber of successful executions of the action
bytes.receivedIntegerNumber of bytes received by EMQX Broker
bytes.sentIntegerNumber of bytes sent by EMQX Broker on this connection
client.authenticateIntegerNumber of client authentications
client.auth.anonymousIntegerNumber of clients who log in anonymously
client.connectIntegerNumber of client connections
client.connackIntegerNumber of CONNACK packet sent
client.connectedIntegerNumber of successful client connections
client.disconnectedIntegerNumber of client disconnects
client.check_aclIntegerNumber of ACL rule checks
client.subscribeIntegerNumber of client subscriptions
client.unsubscribeIntegerNumber of client unsubscriptions
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 0 that were dropped because the message queue was full when sending
delivery.dropped.expiredIntegerNumber of messages dropped due to message expiration on sending
delivery.dropped.no_localIntegerNumber of messages that were dropped due to the No Local subscription option when sending
delivery.droppedIntegerTotal number of discarded messages when sending
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 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, equal to the sum of messages.qos0.receivedmessages.qos1.received and messages.qos2.received
messages.sentIntegerNumber of messages sent to the client, equal to the sum of messages.qos0.sentmessages.qos1.sent and messages.qos2.sent
messages.retainedIntegerNumber of retained messages stored by EMQX Broker
messages.ackedIntegerNumber of received PUBACK and PUBREC packet
packets.receivedIntegerNumber of received packet
packets.sentIntegerNumber of sent packet
packets.connect.receivedIntegerNumber of received CONNECT packet
packets.connack.auth_errorIntegerNumber of received CONNECT packet with failed authentication
packets.connack.errorIntegerNumber of received CONNECT packet with unsuccessful connections
packets.connack.sentIntegerNumber of sent CONNACK packet
packets.publish.receivedIntegerNumber of received PUBLISH packet
packets.publish.sentIntegerNumber of sent PUBLISH packet
packets.publish.inuseIntegerNumber of received PUBLISH packet with occupied identifiers
packets.publish.auth_errorIntegerNumber of received PUBLISH packets with failed the ACL check
packets.publish.errorIntegerNumber of received PUBLISH packet that cannot be published
packets.publish.droppedIntegerNumber of messages discarded due to the receiving limit
packets.puback.receivedIntegerNumber of received PUBACK packet
packets.puback.sentIntegerNumber of sent PUBACK packet
packets.puback.inuseIntegerNumber of received PUBACK packet with occupied identifiers
packets.puback.missedIntegerNumber of received packet with identifiers.
packets.pubrec.receivedIntegerNumber of received PUBREC packet
packets.pubrec.sentIntegerNumber of sent PUBREC packet
packets.pubrec.inuseIntegerNumber of received PUBREC packet with occupied identifiers
packets.pubrec.missedIntegerNumber of received PUBREC packet with unknown identifiers
packets.pubrel.receivedIntegerNumber of received PUBREL packet
packets.pubrel.sentIntegerNumber of sent PUBREL packet
packets.pubrel.missedIntegerNumber of received PUBREC packet with unknown identifiers
packets.pubcomp.receivedIntegerNumber of received PUBCOMP packet
packets.pubcomp.sentIntegerNumber of sent PUBCOMP packet
packets.pubcomp.inuseIntegerNumber of received PUBCOMP packet with occupied identifiers
packets.pubcomp.missedIntegerNumber of missed PUBCOMP packet
packets.subscribe.receivedIntegerNumber of received SUBSCRIBE packet
packets.subscribe.errorIntegerNumber of received SUBSCRIBE packet with failed subscriptions
packets.subscribe.auth_errorIntegerNumber of received SUBACK packet with failed ACL check
packets.suback.sentIntegerNumber of sent SUBACK packet
packets.unsubscribe.receivedIntegerNumber of received UNSUBSCRIBE packet
packets.unsubscribe.errorIntegerNumber of received UNSUBSCRIBE packet with failed unsubscriptions
packets.unsuback.sentIntegerNumber of sent UNSUBACK packet
packets.pingreq.receivedIntegerNumber of received PINGREQ packet
packets.pingresp.sentIntegerNumber of sent PUBRESP packet
packets.disconnect.receivedIntegerNumber of received DISCONNECT packet
packets.disconnect.sentIntegerNumber of sent DISCONNECT packet
packets.auth.receivedIntegerNumber of received AUTH packet
packets.auth.sentIntegerNumber of sent AUTH packet
rules.matchedIntegerNumber of rule matched
session.createdIntegerNumber of sessions created
session.discardedIntegerNumber of sessions dropped because Clean Session or Clean Start is true
session.resumedIntegerNumber of sessions resumed because Clean Session or Clean Start is false
session.takeoveredIntegerNumber of sessions takeovered because Clean Session or Clean Start is false
session.terminatedIntegerNumber of terminated sessions

Request Example

bash
curl -i --basic -u j11c5ff1:qc47fd11fccf1644 -X GET "https://lacd0b7b.test-cn.emqx.cloud:8443/api/metrics"
JSON
{
"data": [
    {
        "node": "emqx@10.12.50.91",
        "metrics": {
            "actions.error": 0,
            "messages.qos1.received": 0,
            "client.disconnected": 9,
            "client.subscribe": 15,
            "packets.pingreq.received": 0,
            "packets.publish.dropped": 0,
            "delivery.dropped": 0,
            "packets.pubrel.received": 0,
            "actions.retry": 0,
            "packets.pubcomp.missed": 0,
            "delivery.dropped.qos0_msg": 0,
            "delivery.dropped.queue_full": 0,
            "client.connack": 11,
            "messages.delayed": 0,
            "packets.sent": 311,
            "actions.success": 0,
            "messages.retained": 5,
            "packets.pubcomp.inuse": 0,
            "session.resumed": 0,
            "messages.qos0.sent": 5,
            "session.terminated": 9,
            "bytes.sent": 824,
            "packets.connect.received": 11,
            "packets.pubrec.received": 0,
            "client.authenticate": 11,
            "packets.pubrec.missed": 0,
            "packets.unsuback.sent": 1,
            "packets.pubrel.sent": 0,
            "messages.delivered": 5,
            "messages.qos2.received": 0,
            "messages.received": 4,
            "messages.qos1.sent": 0,
            "packets.subscribe.received": 15,
            "messages.dropped": 0,
            "client.acl.ignore": 17,
            "packets.connack.error": 1,
            "packets.auth.received": 0,
            "session.takeovered": 0,
            "client.auth.anonymous": 0,
            "packets.auth.sent": 0,
            "packets.unsubscribe.received": 1,
            "delivery.dropped.no_local": 0,
            "messages.acked": 0,
            "packets.pingresp.sent": 279,
            "messages.qos0.received": 4,
            "delivery.dropped.too_large": 0,
            "actions.exception": 0,
            "actions.taken": 0,
            "packets.disconnect.sent": 0,
            "packets.disconnect.received": 7,
            "packets.pubrec.inuse": 0,
            "client.connected": 10,
            "client.acl.deny": 0,
            "packets.publish.error": 0,
            "messages.sent": 5,
            "messages.publish": 4,
            "client.unsubscribe": 1,
            "packets.pubrel.missed": 0,
            "packets.received": 38,
            "bytes.received": 1448,
            "packets.subscribe.error": 0,
            "messages.qos2.sent": 0,
            "client.auth.failure": 1,
            "packets.publish.auth_error": 0,
            "client.auth.success": 10,
            "delivery.dropped.expired": 0,
            "rules.matched": 0,
            "client.acl.allow": 0,
            "packets.unsubscribe.error": 0,
            "client.connect": 11,
            "packets.pubcomp.sent": 0,
            "packets.puback.received": 0,
            "packets.pubcomp.received": 0,
            "session.created": 10,
            "packets.connack.sent": 11,
            "packets.puback.missed": 0,
            "messages.dropped.expired": 0,
            "messages.dropped.no_subscribers": 0,
            "packets.publish.sent": 5,
            "packets.suback.sent": 15,
            "packets.pubrec.sent": 0,
            "packets.puback.sent": 0,
            "packets.publish.inuse": 0,
            "packets.connack.auth_error": 0,
            "messages.forward": 2,
            "session.discarded": 0,
            "packets.puback.inuse": 0,
            "packets.publish.received": 4,
            "client.check_acl": 17,
            "client.auth.ignore": 0,
            "packets.subscribe.auth_error": 0
        }
    },
    {
        "node": "emqx@10.12.50.36",
        "metrics": {
            "actions.error": 0,
            "messages.qos1.received": 0,
            "client.disconnected": 3,
            "client.subscribe": 2,
            "packets.pingreq.received": 0,
            "packets.publish.dropped": 0,
            "delivery.dropped": 0,
            "packets.pubrel.received": 0,
            "actions.retry": 0,
            "packets.pubcomp.missed": 0,
            "delivery.dropped.qos0_msg": 0,
            "delivery.dropped.queue_full": 0,
            "client.connack": 3,
            "messages.delayed": 0,
            "packets.sent": 55,
            "actions.success": 0,
            "messages.retained": 5,
            "packets.pubcomp.inuse": 0,
            "session.resumed": 0,
            "messages.qos0.sent": 2,
            "session.terminated": 3,
            "bytes.sent": 188,
            "packets.connect.received": 3,
            "packets.pubrec.received": 0,
            "client.authenticate": 3,
            "packets.pubrec.missed": 0,
            "packets.unsuback.sent": 0,
            "packets.pubrel.sent": 0,
            "messages.delivered": 2,
            "messages.qos2.received": 0,
            "messages.received": 2,
            "messages.qos1.sent": 0,
            "packets.subscribe.received": 2,
            "messages.dropped": 1,
            "client.acl.ignore": 2,
            "packets.connack.error": 0,
            "packets.auth.received": 0,
            "session.takeovered": 0,
            "client.auth.anonymous": 0,
            "packets.auth.sent": 0,
            "packets.unsubscribe.received": 0,
            "delivery.dropped.no_local": 0,
            "messages.acked": 0,
            "packets.pingresp.sent": 48,
            "messages.qos0.received": 2,
            "delivery.dropped.too_large": 0,
            "actions.exception": 0,
            "actions.taken": 0,
            "packets.disconnect.sent": 0,
            "packets.disconnect.received": 2,
            "packets.pubrec.inuse": 0,
            "client.connected": 3,
            "client.acl.deny": 0,
            "packets.publish.error": 0,
            "messages.sent": 2,
            "messages.publish": 2,
            "client.unsubscribe": 0,
            "packets.pubrel.missed": 0,
            "packets.received": 7,
            "bytes.received": 249,
            "packets.subscribe.error": 0,
            "messages.qos2.sent": 0,
            "client.auth.failure": 0,
            "packets.publish.auth_error": 0,
            "client.auth.success": 3,
            "delivery.dropped.expired": 0,
            "rules.matched": 0,
            "client.acl.allow": 0,
            "packets.unsubscribe.error": 0,
            "client.connect": 3,
            "packets.pubcomp.sent": 0,
            "packets.puback.received": 0,
            "packets.pubcomp.received": 0,
            "session.created": 3,
            "packets.connack.sent": 3,
            "packets.puback.missed": 0,
            "messages.dropped.expired": 0,
            "messages.dropped.no_subscribers": 1,
            "packets.publish.sent": 2,
            "packets.suback.sent": 2,
            "packets.pubrec.sent": 0,
            "packets.puback.sent": 0,
            "packets.publish.inuse": 0,
            "packets.connack.auth_error": 0,
            "messages.forward": 1,
            "session.discarded": 0,
            "packets.puback.inuse": 0,
            "packets.publish.received": 0,
            "client.check_acl": 2,
            "client.auth.ignore": 0,
            "packets.subscribe.auth_error": 0
        }
    }
],
"code": 0
}