Skip to content

The pg_replication_slots metric fails on a replica #1794

@gbartolini

Description

@gbartolini

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 

This is also still present in the prometheus exporter: prometheus-community/postgres_exporter#547

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions