Skip to content

feat(collector): WAL-archiving + backup-health signals (wal_archiving_v1) (#304) - #405

Merged
fheikens merged 1 commit into
mainfrom
304-wal-archiving-collector
Aug 29, 2026
Merged

feat(collector): WAL-archiving + backup-health signals (wal_archiving_v1) (#304)#405
fheikens merged 1 commit into
mainfrom
304-wal-archiving-collector

Conversation

@fheikens

Copy link
Copy Markdown
Contributor

Summary

New read-only collector wal_archiving_v1 capturing recovery posture, not collected today:

  • pg_stat_archiver: archived_count, failed_count, last_archived_wal, last_archived_time, last_failed_wal, last_failed_time, stats_reset.
  • archive/recovery settings: archive_mode, archive_timeout, wal_level, plus presence-only booleans archive_command_configured / restore_command_configured.

Credential safety

archive_command / restore_command can embed secrets (e.g. a cloud credential in the shell command), so the query emits only a boolean presence flag for each — never the command string. Uses current_setting(name, true) <> ''.

Shape

One row per cluster (pg_stat_archiver is a single-row view), 15m cadence, medium retention, not high-sensitivity (nothing to redact). Readable by pg_monitor / pg_read_all_stats — no elevated privilege.

Included (collector-add checklist)

  • Registration (internal/pgqueries/catalog_wal.go), spec with the Output-columns contract (specifications/collectors/wal_archiving_v1.md).
  • Regenerated collector-inventory.json (drift gate), README count bump (102 → 103), docs/collectors.md row.

Verification

go build/vet/gofmt clean; the README-count, collector-inventory-sync, and collectors-doc-completeness guards pass; go test ./tests ./internal/pgqueries ./internal/collector green; docs + de-arq guards pass. (The live-PG output-contract assertion runs in CI's integration-pg.)

closes #304

…_v1) (#304)

Add a read-only collector capturing recovery posture: pg_stat_archiver
progress/failures (archived/failed counts, last archived/failed WAL +
times, stats_reset) plus the archive/recovery settings that determine
whether continuous archiving and PITR are possible (archive_mode,
archive_timeout, wal_level), and presence-only flags for archive_command
/ restore_command.

Credential-safe: archive_command / restore_command can embed secrets, so
the query emits only a boolean presence flag for each — never the command
string. One row per cluster (pg_stat_archiver), 15m cadence, medium
retention, not high-sensitivity.

Includes the spec (with the Output-columns contract), the regenerated
collector-inventory.json, the README count bump (102->103), and the
docs/collectors.md row.
@fheikens
fheikens merged commit 69ca1d4 into main Aug 29, 2026
11 checks passed
@fheikens
fheikens deleted the 304-wal-archiving-collector branch August 29, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collector: WAL-archiving and backup-health signals

1 participant