feat(collector): WAL-archiving + backup-health signals (wal_archiving_v1) (#304) - #405
Merged
Conversation
…_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New read-only collector
wal_archiving_v1capturing 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_mode,archive_timeout,wal_level, plus presence-only booleansarchive_command_configured/restore_command_configured.Credential safety
archive_command/restore_commandcan 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. Usescurrent_setting(name, true) <> ''.Shape
One row per cluster (
pg_stat_archiveris a single-row view), 15m cadence, medium retention, not high-sensitivity (nothing to redact). Readable bypg_monitor/pg_read_all_stats— no elevated privilege.Included (collector-add checklist)
internal/pgqueries/catalog_wal.go), spec with the Output-columns contract (specifications/collectors/wal_archiving_v1.md).collector-inventory.json(drift gate), README count bump (102 → 103),docs/collectors.mdrow.Verification
go build/vet/gofmtclean; the README-count, collector-inventory-sync, and collectors-doc-completeness guards pass;go test ./tests ./internal/pgqueries ./internal/collectorgreen; docs + de-arq guards pass. (The live-PG output-contract assertion runs in CI'sintegration-pg.)closes #304