---
title: "Broker statistics"
method: GET
path: "/api/v1/stats"
tags: ["Admin"]
---

# Broker statistics

`GET /api/v1/stats`

Returns all broker counters in one call. Every field is an atomic load —
zero allocation, zero contention. Raw cumulative counters are exposed;
clients compute rates by polling.

## Response `200`

Current broker statistics

- StatsResponse — Top-level fields are aggregated totals across all protocols. The `by_protocol` section contains per-protocol breakdowns with protocol-specific fields (e.g. MQTT subscriptions, AMQP channels). The `queues` section is cross-protocol and is present only when the node runs a queue manager.
  - `uptime_seconds` number, double — Broker uptime in seconds
  - `connections` ConnectionStats
    - `current` integer — Currently connected clients (sum across protocols)
    - `total` integer — Total connections since startup
    - `disconnections` integer — Total disconnections since startup
  - `messages` MessageStats — Aggregated message counters across all protocols
    - `received` integer
    - `sent` integer
  - `bytes` ByteStats
    - `received` integer
    - `sent` integer
  - `errors` ErrorStats — Aggregated protocol error count
    - `protocol` integer
  - `by_protocol` ByProtocolStats
    - `mqtt` MQTTStats — MQTT-specific counters
      - `connections` ConnectionStats
        - `current` integer — Currently connected clients (sum across protocols)
        - `total` integer — Total connections since startup
        - `disconnections` integer — Total disconnections since startup
      - `messages` MQTTMessageStats
        - `received` integer
        - `sent` integer
        - `publish_received` integer — PUBLISH packets received
        - `publish_sent` integer — PUBLISH packets sent
      - `bytes` ByteStats
        - `received` integer
        - `sent` integer
      - `subscriptions` MQTTSubscriptionStats
        - `active` integer — Currently active MQTT topic subscriptions
        - `retained_messages` integer — Number of retained messages stored
      - `errors` MQTTErrorStats
        - `protocol` integer
        - `auth` integer — Authentication failures
        - `authz` integer — Authorization failures
        - `packet` integer — Malformed packet errors
    - `amqp` AMQPStats — AMQP 0.9.1-specific counters
      - `connections` ConnectionStats
        - `current` integer — Currently connected clients (sum across protocols)
        - `total` integer — Total connections since startup
        - `disconnections` integer — Total disconnections since startup
      - `messages` MessageStats — Aggregated message counters across all protocols
        - `received` integer
        - `sent` integer
      - `bytes` ByteStats
        - `received` integer
        - `sent` integer
      - `channels` integer — Currently open AMQP channels
      - `consumers` integer — Currently active AMQP consumers
      - `errors` ErrorStats — Aggregated protocol error count
        - `protocol` integer
      - `local_principals` AMQPLocalPrincipalStats — Bounded internal-listener counters without principal-derived dimensions
        - `active_connections` integer — Active connections authenticated as local principals
        - `publish_timeouts` integer — Publications NACKed because the durable append did not complete in time
        - `publish_rejections` integer — Publications refused because the stream already had the maximum durable appends waiting on storage
        - `authentication` AMQPLocalAuthenticationStats
          - `success` integer — Successful local-principal authentications
          - `failure` integer — Failed local-principal authentications
        - `authorization` AMQPLocalAuthorizationStats
          - `publish_denied` integer — Local-principal publications denied by the publish ACL
          - `subscribe_denied` integer — Local-principal consumer operations denied by the subscribe ACL
          - `operation_denied` integer — AMQP operations denied because the principal's role does not permit them
        - `reloads` AMQPLocalReloadStats
          - `success` integer — Successful local-principal snapshot reloads
          - `failure` integer — Failed local-principal snapshot reloads
          - `forced_disconnects` integer — Sessions disconnected after principal, credential, or ACL revocation
  - `queues` QueueStats — Queue manager counters. Queues are shared by every protocol, so this section sits beside `by_protocol` rather than inside it. Omitted when the node runs no queue manager.
    - `capture_failures` integer — Matching queues a captured publish failed to reach, because the append failed or the queue's configuration could not be read. The unit is the queue, so a publish missing two of its matching queues counts twice. A resolution failure, where the matching set is unknown, counts once.
    - `capture_dropped` integer — Capture jobs discarded before any append was attempted, because the capture backlog was full or shutdown drained past its deadline. Distinct from `capture_failures`, where the append was tried and did not succeed: a rising `capture_dropped` means capture cannot keep up with the publish rate. Capture runs off the publish path and never fails the publish, so these two counters are its only signal.
    - `claims` QueueAttemptStats
      - `attempts` integer
      - `successes` integer
      - `failures` integer
    - `steals` QueueAttemptStats
      - `attempts` integer
      - `successes` integer
      - `failures` integer
    - `acknowledgments` QueueAckStats
      - `ack` integer
      - `nack` integer
      - `reject` integer
      - `dlq` integer — Messages moved to a dead-letter queue
    - `pending` QueuePendingStats — Pending entry list size. Only classic queues maintain one; a stream consumer group tracks a cursor instead.
      - `current` integer
      - `high_water` integer

## Other responses

- `405` — Method not allowed (non-GET request)
- `503` — Broker not available

---

[API](https://skmtc.net/absmach/apis/fluxmq-admin-api.md) · [All operations](https://skmtc.net/absmach/apis/fluxmq-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/absmach/fluxmq-admin-api/versions/55b06d78c850/schema)
