External Services

Postgres WAL & archive health snapshot

Changed on

Returns the latest WAL/archive health snapshot recorded by the background health monitor for a Postgres external service. Powers the warning banner on the service detail page when the disk is filling up due to stale replication slots, archive backlog, or misconfigured archive_command.

Returns 404 when no snapshot exists yet (probe hasn't run, or the service isn't Postgres). When the last check could not run (a database on a worker whose agent predates the WAL probe, or cannot be reached), the 404 has type https://temps.sh/probs/wal-health-not-checked and carries reason and checked_at, so the page can say the check is not happening.

get/external-services/{id}/wal-health

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    none declared

Path parameters

idinteger required

External service ID

Response

Latest WAL health snapshot

archive_backloginteger required

Number of archive_status/*.ready files — un-shipped WAL segments. 0 when archive_status_unreadable is set.

archive_commandstring nullable

The literal archive_command setting. May be empty or /bin/true when archiving is effectively disabled despite archive_mode = on.

archive_librarystring nullable

The archive_library setting (PostgreSQL 15+), when one archives WAL instead of archive_command.

archive_mode'off' | 'on' | 'always' | 'unknown' required
archive_oldest_ready_age_secsinteger nullable

Age of the oldest archive_status/*.ready file (seconds), None when no segment is waiting.

archive_status_unreadableboolean

The role may not list archive_status: the backlog, the oldest waiting segment's age and stall detection are unknown.

archiver_archived_countinteger nullable

Segments archived since the statistics were last reset.

archiver_failed_countinteger nullable
archiver_last_archived_atstring date-time nullable

When a segment was last archived successfully.

archiver_last_failed_atstring date-time nullable
archiver_last_failed_walstring nullable

The segment whose archiving failed last.

max_wal_size_bytesinteger required

max_wal_size setting in bytes (parsed from pg_settings).

oldest_wal_age_secsinteger required

Age of the oldest WAL file in pg_wal/ (seconds).

pg_wal_bytesinteger required

Total size of files under pg_wal/, from pg_ls_waldir().

probed_atstring date-time required

When the snapshot was taken.

Changes

    • breaking

      added subschema #4 subschema #5 to the warnings/items response property oneOf list for the response status

    • info

      added the optional property archive_library to the response with the status

    • info

      added the optional property archive_status_unreadable to the response with the status

    1 more change in this revision