Repository navigation
Commit e2d6bd0
authored
fix(metrics): skip
After a PostgreSQL instance is demoted from primary to standby, the
`pg_stat_archiver` view retains stale data from when the instance was
archiving WAL files. This causes misleading metrics and false alerts
(e.g., "last archive age > 7 minutes") on standby nodes that do not
actively archive WAL.
This fix adds a predicate_query to the `pg_stat_archiver` metrics
collection that only runs the query on instances that actually perform
WAL archiving:
- Primary instances (not in recovery)
- Designated primary replicas (archive_mode='always' in replica
clusters)
Regular standby nodes will no longer export `pg_stat_archiver` metrics,
preventing stale data from triggering false alerts.
Fixes #9101
Signed-off-by: Armando Ruocco <[email protected]>pg_stat_archiver metrics on non-archiving standbys (#9411)1 parent 53cb703 commit e2d6bd0
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| |||
0 commit comments