pg_replication_lag parameter from custom queries calculated incorrectly

Description

 

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 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

Aaditya Dubey March 31, 2024 at 6:52 AM

Hi

Thank you for the report and feedback.

Verified as described

Details

Assignee

Reporter

Priority

Components

Labels

Needs QA

Needs Doc

Planned Version/s

Affects versions

Created March 21, 2024 at 2:12 PM
Updated January 9, 2025 at 8:36 AM