Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Postgres replication slot monitoring #1060

Open
cacraig opened this issue Dec 18, 2024 · 0 comments
Open

[Feat]: Postgres replication slot monitoring #1060

cacraig opened this issue Dec 18, 2024 · 0 comments

Comments

@cacraig
Copy link

cacraig commented Dec 18, 2024

Problem

Hi!

Since Postgres 17, the pg_replication_slots returns an "inactive_since" field for replication slots where active = FALSE. It would be super helpful to monitor for streaming replicas that go offline.

Description

^^

Importance

really want

Value proposition

(1) This is very useful information to monitor for DB admins. A replica going offline or losing connection with the primary can cause downtime, stale data, table bloat on the primary, among other things.

Proposed implementation

A simple chart or monitor that just shows the number of expected active replica slots: select count(*) from pg_replication_slots; vs the number of actual active slots select count(*) from pg_replication_slots where active=TRUE; would be great. I think it would work exactly like your monitor for RAID configurations (Storage -> Management -> md.health, and md.disks). Where it shows the number of faulty (inactive replication slots), and the total number (total replication slots).

Displaying the new inactive_since (timestamp or in seconds/mins) field for inactive replicas would also be neat if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant