Observability
Prometheus metrics with their types and labels, a scrape configuration, and logging.
OrbitMQ exposes Prometheus metrics at /metrics on the admin API listener and writes
structured logs to stderr.
How metrics are collected
Each data-plane core keeps its own plain counters and histograms, updated without atomics or locks. A scrape of
/metrics asks every core for a snapshot over its control ring, then adds the snapshots up into node-wide values.
Nothing is collected between scrapes, so metrics cost nothing on the publish path.
Each scrape also walks the sessions on every core to compute the state gauges, so a scrape interval of 15 seconds or
more is a sensible default. If a core does not answer within [admin] request_timeout_ms (default 2000 ms), the
scrape fails with HTTP 504; if a core's control queue is full, with 503.
Enabling the endpoint
/metrics is served by the admin API, which needs a bearer token (or insecure = true on a loopback address):
[admin]
listen = "0.0.0.0:18083" # default 127.0.0.1:18083
tokens = ["a-long-random-token"] # or ORBITMQ_ADMIN_TOKENScurl -H 'Authorization: Bearer a-long-random-token' http://localhost:18083/metricsThe response uses the Prometheus text format, version 0.0.4.
Prometheus scrape configuration
scrape_configs:
- job_name: orbitmq
scrape_interval: 15s
metrics_path: /metrics
authorization:
type: Bearer
credentials_file: /etc/prometheus/orbitmq-token # file containing one of the [admin] tokens
static_configs:
- targets: ['broker-1.internal:18083']Metrics
All metrics have the prefix orbitmq_ and describe one node.
Process
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_build_info | gauge | version | Always 1; the label carries the broker version. |
orbitmq_uptime_seconds | gauge | Seconds since the broker started. | |
orbitmq_runtime_info | gauge | backend | Always 1; the label is the data-plane I/O backend: io_uring, epoll (Linux fallback, the default in containers) or kqueue (macOS). See Running in containers. |
orbitmq_cores | gauge | Number of data-plane cores. | |
orbitmq_core_busy_ratio | gauge | core | Share of the last second each core spent in broker event handlers (0 to 1). |
orbitmq_core_busy_seconds_total | counter | core | Time each core has spent in broker event handlers. |
Flow control and subscribe visibility
See cross-core routing for the mechanisms behind these counters.
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_core_throttled_total | counter | core | Times a connection reader (or the core-to-core ring consumer) on each core was paused because deliveries it caused were blocked (ingress back-pressure). |
orbitmq_core_cut_excluded_total | counter | core | Live deliveries skipped on each core because the message was processed before the new subscription existed. Not a loss: such a message never belongs to that subscription. |
orbitmq_core_retained_deduplicated_total | counter | core | Duplicate copies skipped on each core because a new subscription would otherwise receive the same message both as a retained and as a live message. |
Event loop and I/O
These counters show how much work each core does per pass of its event loop. Dividing one by another gives batch
sizes, which help when tuning cores: for example, inbox_messages / inbox_batches is the average number of
messages per core-to-core hand-off, and socket_writes divided by delivered messages shows how well writes are
batched.
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_core_loop_passes_total | counter | core | Passes of each core's event loop (run the ready tasks, then poll for I/O). |
orbitmq_core_loop_parks_total | counter | core | Passes that ended with the core waiting for I/O because it had nothing to do. |
orbitmq_core_handoff_batches_total | counter | core | Batches each core sent to other cores. |
orbitmq_core_handoff_messages_total | counter | core | Messages in those batches. |
orbitmq_core_handoff_wakeups_sent_total | counter | core | Batches that had to wake the receiving core because it was waiting. |
orbitmq_core_handoff_wakeups_skipped_total | counter | core | Batches that needed no wake-up. |
orbitmq_core_inbox_batches_total | counter | core | Reads of each core's inbox from other cores that returned messages. |
orbitmq_core_inbox_messages_total | counter | core | Messages those reads returned. |
orbitmq_core_socket_reads_total | counter | core | Client socket reads that returned data. |
orbitmq_core_socket_writes_total | counter | core | Write calls to client sockets. |
Connections
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_connections_current | gauge | listener, protocol | Connected clients (CONNACK sent). |
orbitmq_connections_total | counter | listener, protocol | Successful CONNECTs. |
orbitmq_connections_accepted_total | counter | listener | Network connections accepted. |
orbitmq_connections_refused_total | counter | listener, reason | CONNECTs refused because a connection limit was reached (reason="max_connections"). |
orbitmq_connections_open | gauge | Open network connections in any phase, including before CONNACK. |
Traffic
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_packets_received_total | counter | type | MQTT control packets received. |
orbitmq_packets_sent_total | counter | type | MQTT control packets sent. |
orbitmq_messages_received_total | counter | qos | PUBLISH packets received from clients. |
orbitmq_messages_sent_total | counter | qos | PUBLISH packets sent to clients, re-deliveries included. |
orbitmq_bytes_received_total | counter | MQTT bytes received, after TLS and WebSocket decoding. | |
orbitmq_bytes_sent_total | counter | MQTT bytes sent, before TLS and WebSocket encoding. | |
orbitmq_dropped_messages_total | counter | reason | Messages dropped. |
orbitmq_publish_deliver_latency_seconds | histogram | Publish-to-delivery latency of messages handed over between cores, measured on the delivering core. |
State
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_sessions | gauge | state | Sessions, connected or disconnected (kept for a later reconnect). |
orbitmq_sessions_persistent | gauge | Sessions with a non-zero Session Expiry Interval. | |
orbitmq_subscriptions | gauge | Subscriptions of all sessions. | |
orbitmq_inflight_messages | gauge | Unacknowledged outgoing QoS 1 and QoS 2 messages. | |
orbitmq_queued_messages | gauge | Messages waiting in session queues. | |
orbitmq_retained_messages | gauge | Retained messages stored. | |
orbitmq_retained_bytes | gauge | Bytes held by retained messages. | |
orbitmq_memory_budget_bytes | gauge | The node's memory budget (0: no budget). | |
orbitmq_memory_used_bytes | gauge | kind | Bytes counted against the budget. A QoS 1 or 2 message being sent shows under both inflight and outbound, and counts once. |
orbitmq_memory_budget_closes_total | counter | Connections closed because their buffers put the node over its budget. |
Authentication
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_auth_total | counter | result | CONNECTs accepted (success) or refused (failure) by the authentication chain. Stays at 0 while neither chain has a source and the admin API is off (no authentication runs then). |
orbitmq_auth_source_decisions_total | counter | chain, source, kind, result | Answers of each authentication and authorization source: allow, deny or ignore. For authorization sources, one per PUBLISH or SUBSCRIBE check that reached the source. |
orbitmq_auth_source_checks_total | counter | chain, source, kind | Network sources (jwt, http, postgres, mysql, redis, mongodb): queries sent to the backend. |
orbitmq_auth_source_errors_total | counter | chain, source, kind | Network sources: backend errors, timeouts and max_in_flight refusals. |
orbitmq_auth_source_cache_hits_total | counter | chain, source, kind | Network sources: answers taken from the cache. |
orbitmq_auth_source_enabled | gauge | chain, source, kind | 1 when the source is enabled, 0 when it is skipped. |
orbitmq_auth_source_position | gauge | chain, source, kind | The source's 0-based position in its chain. |
chain is authentication or authorization, source the source's name. See
Authentication.
Rules
| Metric | Type | Labels | Description |
|---|---|---|---|
orbitmq_rule_messages_total | counter | rule, result | Messages seen by each rule: matched (evaluated), passed (WHERE true), filtered (WHERE not true), failed (evaluation error), dropped (the core's rules queue was full). |
orbitmq_rule_action_messages_total | counter | rule, action, type, result | Messages handled by each rule action: success, failed, dropped (action queue full), retried, dead_lettered. |
orbitmq_rule_action_queued | gauge | rule, action, type | Messages waiting in each action's queue. |
orbitmq_connector_up | gauge | connector, kind | 1 while an MQTT or Kafka connector is connected, 0 otherwise. |
rule is the rule id, action the action's 0-based position in the rule, type one of republish, webhook,
mqtt and kafka. The series exist only while the rule engine is enabled. See
Rules and integrations.
Label values
| Label | Values |
|---|---|
listener | Listener names from the configuration (default for listen). |
protocol | 3.1, 3.1.1, 5.0 |
type | connect, connack, publish, puback, pubrec, pubrel, pubcomp, subscribe, suback, unsubscribe, unsuback, pingreq, pingresp, disconnect, auth |
qos | 0, 1, 2 |
reason (dropped) | ring_full: QoS 0 hand-off dropped because the destination core stayed overloaded (its backlog passed four ring capacities while the publisher was already being throttled). qos0_queue_full: QoS 0 delivery to a slow or offline client. queue_full: QoS 1 or 2 delivery to a session whose queue was full (max_queued_messages or max_queued_bytes). expired: the message expired before delivery. too_large: larger than the receiving client's Maximum Packet Size. no_subscribers: no subscription matched. memory_limit: shed from one of the longest session queues because the node's queued messages exceeded their memory budget (see Session queues). |
kind | queued, inflight, outbound, read, retained |
state | connected, disconnected |
result | success, failure (orbitmq_auth_total); allow, deny, ignore (orbitmq_auth_source_decisions_total); matched, passed, filtered, failed, dropped (orbitmq_rule_messages_total); success, failed, dropped, retried, dead_lettered (orbitmq_rule_action_messages_total) |
core | Core index, from 0. |
The latency histogram has log-linear buckets: the first ends at 1.024 µs, then two buckets per power of two up to
about 17 seconds, then +Inf.
Useful queries
# Messages in and out per second
sum(rate(orbitmq_messages_received_total[1m]))
sum(rate(orbitmq_messages_sent_total[1m]))
# Connected clients per listener
sum by (listener) (orbitmq_connections_current)
# Dropped messages per second, by reason
sum by (reason) (rate(orbitmq_dropped_messages_total[5m]))
# p99 cross-core delivery latency
histogram_quantile(0.99, sum by (le) (rate(orbitmq_publish_deliver_latency_seconds_bucket[5m])))
# Busiest core
max(orbitmq_core_busy_ratio)
# Messages dropped by the rule engine per second, by rule
sum by (rule) (rate(orbitmq_rule_messages_total{result="dropped"}[5m]))Logs
Logs go to stderr in a human-readable format, one event per line, for example:
2026-10-13T18:21:32.378224Z INFO orbitmq_core::broker: listening listener=default kind=tcp addr=0.0.0.0:1883Set the level with log in orbitmq.toml or ORBITMQ_LOG, using tracing env-filter syntax: info (default),
debug, warn, or per module, such as info,orbitmq_core=debug. The filter is read at start-up.
State-changing admin API requests are logged at info under the target orbitmq::admin::audit (see
Audit log), and invalid admin tokens at warn with the peer address.
Configuration risks are logged as warnings at start-up, among them secret files and TLS private keys readable by
other users, PROXY listeners without trusted_proxies, an admin API on a non-loopback address without TLS, JWT
sources that check no issuer or audience, and insecure connections allowed to authentication sources.