You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The pg_replication_slots metric fails on a replica #1794
The file config/manager/default-monitoring.yaml contains a metric called pg_replication_slots that at the moment can only be run if executed on the primary due to the execution of functions that cannot be executed on replicas. This is similar to the problem resolved by the patch contained in #1666 (issue #1604).
When running this query on a standby it returns WAL control functions cannot be executed during recovery:
SELECT slot_name,
slot_type,
database,
active,
pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
FROM pg_catalog.pg_replication_slots
WHERE NOT temporary
Activity
sajdakabir commentedon Jul 2, 2023
@gbartolini can I work on this issue?
gbartolini commentedon Sep 4, 2023
Of course, please propose a patch if interested
mblp commentedon Sep 16, 2023
prometheus-community/postgres_exporter#914
fix: make `pg_replication_slots` default metric run on replicas
fix: make `pg_replication_slots` default metric run on replicas (#2897)
fix: make `pg_replication_slots` default metric run on replicas (#2897)
fix: make `pg_replication_slots` default metric run on replicas (#2897)