You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do?
I tried to figure out that actually get's returned by pg_stat_replication_pg_wal_lsn_diff metric, so I reviewed your code, to be precise
What did you expect to see?
Replication related data gathering.
What did you see instead? Under which circumstances?
Total byte count written in wal over database lifetime.
PostgreSQL documentation states:
pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric
Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.87 to get the replication lag.
and pg_lsn('0/0') in essence will return beginning of the wal so it's total bytes written in the wall. Metric it self is sane but it's not related to replication and it could/should be gathered for all database instances despite what pg_is_in_recovery() states
Environment
N/A
System information: Linux 5.10.167-147.601.amzn2.x86_64 x86_64
postgres_exporter version issues applies to latest version as well:
postgres_exporter, version 0.11.1 (branch: HEAD, revision: b5fd246)
build user: root@a2c981f603ff
build date: 20220818-20:58:17
go version: go1.18.5
platform: linux/amd64
postgres_exporter flags:
N/A
PostgreSQL version: 14.6
Logs:
N/A
The text was updated successfully, but these errors were encountered:
What did you do?
I tried to figure out that actually get's returned by pg_stat_replication_pg_wal_lsn_diff metric, so I reviewed your code, to be precise
postgres_exporter/cmd/postgres_exporter/queries.go
Line 53 in ddd5136
What did you expect to see?
Replication related data gathering.
What did you see instead? Under which circumstances?
Total byte count written in wal over database lifetime.
PostgreSQL documentation states:
and
pg_lsn('0/0')
in essence will return beginning of the wal so it's total bytes written in the wall. Metric it self is sane but it's not related to replication and it could/should be gathered for all database instances despite whatpg_is_in_recovery()
statesEnvironment
N/A
System information:
Linux 5.10.167-147.601.amzn2.x86_64 x86_64
postgres_exporter version issues applies to latest version as well:
postgres_exporter flags:
N/A
PostgreSQL version:
14.6
Logs:
N/A
The text was updated successfully, but these errors were encountered: