As you can see, custom query version is almost the same but misses the check for pg_last_wal_receive_lsn () = pg_last_wal_replay_lsn () as a result a replica of idle primary has a false positive lag
Possible solution: 1. Drop custom query 2. Check dashboards if we use this metric and replace by integrated metrics
How to test
None
How to document
None
AFFECTED CS IDs
CS0044755
Activity
Nurlan Moldomurov July 24, 2024 at 9:06 AM
Hi we are planning to drop this query from custom queries and use built-in one in PMM 3.X
The exporter has a better query pg_replication_lag_seconds
https://github.com/percona/postgres_exporter/blob/pmm-2.41.2/collector/pg_replication.go#L55C24-L64C19
As you can see, custom query version is almost the same but misses the check for
pg_last_wal_receive_lsn () = pg_last_wal_replay_lsn ()
as a result a replica of idle primary has a false positive lagPossible solution:
1. Drop custom query
2. Check dashboards if we use this metric and replace by integrated metrics