Report the transactional outbox's health
Reports how much work the accounts service’s outbox is holding, broken down by status and event type, and how old the oldest row in each state is. Covers the whole queue rather than one organization, and carries no organization id, account id, payload, vault object or error text: it says how much work is stuck and what kind, not whose. A failed row is terminal and will not be retried, so a non-zero failed count is work the platform has dropped and needs an operator. A processing row older than a few seconds means no worker is running to reclaim it. Readable by a client credential holding the credential:read scope and by an organization admin of a configured internal organization. API keys and every other organization are refused.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The queue's current health
The queue's health, as the endpoint reports it.
Lives here rather than in api::accounts_api::response with its siblings,
because it is built on [OutboxStatus] and [OutboxEventType], which are
this service's own Postgres enums and belong to the worker that drains the
queue. Moving them into the shared crate to put the response there would
hand every other service a vocabulary for a table only this one has.
entries is the raw grouping and the rolled-up fields below are derived
from it, rather than the other way round. A reader wanting "how bad is it"
gets the totals without doing arithmetic; a reader wanting "what kind of
work is stuck" gets the breakdown without a second request.
Every status and event type that has at least one row, counted.
The oldest outstanding claim.
A processing row is reclaimed after five seconds, so anything much
older than that means no worker is running to reclaim it. This is how
"the outbox worker is down" looks from the outside.
When the oldest terminally failed row was queued.
failed is terminal: a row reaches it only after the attempt limit, and
the claim query deliberately does not take it back. Nothing will retry
it, so this figure only ever grows until somebody acts on it.
When the oldest row still waiting was queued.
The figure worth alerting on. A healthy queue drains in under a second, so a pending row minutes old means the worker is behind or gone.