mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-02-27 07:50:47 +00:00
fix pg_replication_lag_seconds (#895)
Signed-off-by: Vladimir Luksha <waldemarluksha@gmail.com> Co-authored-by: Vladimir Luksha <luksha@limcore.io>
This commit is contained in:
parent
dbc7b0b229
commit
0b6d9860ab
@ -55,6 +55,7 @@ var (
|
||||
pgReplicationQuery = `SELECT
|
||||
CASE
|
||||
WHEN NOT pg_is_in_recovery() THEN 0
|
||||
WHEN pg_last_wal_receive_lsn () = pg_last_wal_replay_lsn () THEN 0
|
||||
ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())))
|
||||
END AS lag,
|
||||
CASE
|
||||
|
Loading…
Reference in New Issue
Block a user