Hello PostgreSQL community,
I am monitoring a PostgreSQL 10 standby server using:
pg_last_xlog_receive_location()
and
pg_last_xlog_replay_location()
The current query only checks replay lag. I would like guidance on a more comprehensive monitoring approach that can detect:
1. Standby disconnected from the primary.
2. WAL receiver process stopped.
3. Required WAL segment removed from the primary
(for example: "requested WAL segment has already been removed").
I would like to know:
- Which SQL checks are recommended for these scenarios?
- Which conditions require external monitoring or log analysis?
- What is the recommended practice for monitoring PostgreSQL 10 streaming replication health?
Thank you.
Bilal Abdulkadir Muhammed