postgres exporter catch metric pg_pg_replication_lag_seconds,the sql
SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag
occurs an error every time when backup,
pg_exporter_last_scrape_error = 1
pg_last_xact_replay_timestamp cannot use when backup,so every day we receive an alert
postgres exporter catch metric pg_pg_replication_lag_seconds,the sql SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag
occurs an error every time when backup, pg_exporter_last_scrape_error = 1
pg_last_xact_replay_timestamp cannot use when backup,so every day we receive an alert