On Mon, Jul 20, 2026 at 05:23:07PM +0300, Bilal Abdulkadir Muhammed wrote:
> 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.

You can see this in https://pgdoc.link/pg_stat_replication@10

> 2. WAL receiver process stopped.

Not sure how this is different than #1

> 3. Required WAL segment removed from the primary
>    (for example: "requested WAL segment has already been removed").

Check logs, and also check for existence of streaming.

> I would like to know:
> - Which SQL checks are recommended for these scenarios?
> - Which conditions require external monitoring or log analysis?

I would always monitor logs for errors.

> - What is the recommended practice for monitoring PostgreSQL 10 streaming
> replication health?

The recommended practice is to upgrade. Pg 10 stopped being *supported*
almost 4 years ago!

Upgrade to something that is supported. Preferably newest possible (18
now, 19 by the end of this year).

Best regards,

depesz



Reply via email to