postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Is there a Prometheus metric to indicate a PGO cluster is configured as standby?

Open johnswarbrick-napier opened this issue 9 months ago • 1 comments

PGO version: 5.5.1 Postgres version: 13

I have configured my PostgreSQL cluster as a standby which is replicating with the primary through S3 object storage with a simple config option:

postgres:
  standby:
    enabled: true
    repoName: repo1

The cluster is successfully synchronising, but monitoring alerts are being triggered for backups not running and WAL logs not being archived by the standby - which is expected:

(ccp_archive_command_status_seconds_since_last_fail > 30) or (ccp_archive_command_status_archived_count == 0)
ccp_backrest_last_incr_backup_time_since_completion_seconds{stanza="db"} > 129600

Is there any Prometheus metric exported by PGO to indicate the cluster is running as a standby?

I was looking at pg_settings_hot_standby but that seems to indicate a replica rather than a cluster.

Thanks

johnswarbrick-napier avatar Apr 01 '25 16:04 johnswarbrick-napier

Hi - any thoughts on this?

I just need a reliable method for determining from a Prometheus metric that a PostgreSQL cluster is in standby mode.

Thanks

johnswarbrick-napier avatar Apr 24 '25 09:04 johnswarbrick-napier