Monitor streaming replication
Implement monitoring of streaming replication as per https://wiki.postgresql.org/wiki/Streaming_Replication
Hello! Just interesting what is the status of this issue?
Work hasn't started on this feature yet though I have done some research into how it should be measured. Scheduling is uncertain I'm afraid.
Code contributions are welcomed.
Unfortunately I'm not a C programmer, but isn't it hard to add one key with one query "SELECT pg_is_in_recovery()"? Also useful to know replication time lag in seconds: SELECT extract(epoch from now() - pg_last_xact_replay_timestamp())
That should be fairly simple, yes. If it would be valuable I can look to add it soon. Testing my memory, but I was looking at ways to query the transaction log position on all cluster members to determine their progress.
In the mean time, you can use the Query item keys to execute customer queries according to your needs.
Thanks! Kindly in PostgreSQL I prefer to not use word "cluster" because it is just master-slave replication.
I've heard it said before from other PostgreSQL users that clustering is not the right term. So I'll gladly reconsider. I grew up on Windows Failover Cluster Services which only supports active-passive but still counts itself as a cluster... I guess today it means something more impressive.
I've implemented a decent method of monitoring streaming on 9.2+, but it requires the config file mods from libzbxpgsql 1.1.
I'll put together a sample in the next few days and share it here.
--Rob
OK - I've put something in Github for you guys to try out. Let me know if it works for you. libzbxpgsql-streaming
Any news on testing/implementing @robbrucks suggestion?
It's a great suggestion and I'd love to implement it, but unfortunately my develop efforts are heavily steered by whatever projects I have going on at work. In the meantime, I'd gladly work with anyone on a pull request or recommend that you check out Rob's template: https://github.com/robbrucks/libzbxpgsql-streaming