Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Send replication slots metrics to Prometheus #60

Merged
merged 32 commits into from
Sep 20, 2019
Merged

Conversation

bern4rdelli
Copy link
Contributor

@bern4rdelli bern4rdelli commented Sep 18, 2019

Send the status and lag metrics to Prometheus.
We will add two alerts, one when the status is equal to zero for more than five minutes, and another when the lag (in MB) is greater than X mb (TBD);

The local results are:

# HELP postgresql_replication_slot_lag Total lag of the replication slots
# TYPE postgresql_replication_slot_lag gauge
postgresql_replication_slot_lag{database_name="uuid",slot_name="my_dummy_wal"} 499
# HELP postgresql_replication_slot_status State of the replication slots
# TYPE postgresql_replication_slot_status gauge
postgresql_replication_slot_status{database_name="uuid",slot_name="my_dummy_wal"} 0

postgres/version.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
gauges/logical_replication.go Outdated Show resolved Hide resolved
@bern4rdelli bern4rdelli marked this pull request as ready for review September 20, 2019 14:19
bern4rdelli and others added 4 commits September 20, 2019 11:19
Co-Authored-By: Diogo Nicoleti <diogo.nicoleti@contaazul.com>
Co-Authored-By: Diogo Nicoleti <diogo.nicoleti@contaazul.com>
Co-Authored-By: Diogo Nicoleti <diogo.nicoleti@contaazul.com>
Co-Authored-By: Diogo Nicoleti <diogo.nicoleti@contaazul.com>
Copy link
Contributor

@diogonicoleti diogonicoleti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@diogonicoleti diogonicoleti merged commit d87a80c into master Sep 20, 2019
@diogonicoleti diogonicoleti deleted the replication branch September 20, 2019 14:34
@bern4rdelli bern4rdelli changed the title [JARVIS#DE-556] Send replication slots metrics to Prometheus Send replication slots metrics to Prometheus Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants