Skip to main content

Metrics

The outbox exposes Micrometer metrics so its state and activity can be monitored in production. Metrics are only recorded when a MeterRegistry Spring bean is available — for example by adding the jeap-spring-boot-monitoring-starter. Without a MeterRegistry, no metrics are collected and the outbox still works.

The gauges are refreshed on a fixed interval by OutboxMetricsUpdateScheduler (every metrics-update-interval, default 10 seconds).

Metrics

NameTypeDescription
outbox_messages_ready_to_be_sent_countGaugeNumber of messages ready to be relayed (the outbox "lag")
outbox_messages_failed_countGaugeNumber of messages in state failed, split by tag resend_status
outbox_messages_post_totalCounterNumber of messages posted to the outbox, split by tags delivery_type and tx_status
outbox_messages_transmitTimerCount and duration of messages actually transmitted to Kafka, tagged by delivery_type
outbox_messages_ready_to_be_sent_queryTimerCount and duration of the query that fetches messages ready to be sent

The outbox_messages_transmit timer is exported by Micrometer as outbox_messages_transmit_seconds_count, _sum and _max.

Tags

TagValuesUsed by
delivery_typeimmediate, scheduledoutbox_messages_post_total, outbox_messages_transmit
tx_statuscommitted, rolled_back, unknownoutbox_messages_post_total
resend_statusresend_enabled, resend_disabledoutbox_messages_failed_count

tx_status reflects the outcome of the transaction in which the message was posted: committed and rolled_back are recorded via a transaction synchronization; unknown is used when no transaction synchronization is active when counting the post.

What to monitor

  • outbox_messages_ready_to_be_sent_count rising steadily indicates the relay is falling behind (for example Kafka problems or the relay being disabled).
  • outbox_messages_failed_count (with resend_disabled) above zero means messages need operator attention — see Failure handling.
  • outbox_messages_post_total{tx_status="rolled_back"} indicates messages that were posted in transactions that later rolled back and were therefore correctly not sent.