Skip to content

HarshitRuwali/pgpulse

Repository files navigation

PgPulse

A Rust service/CLI that monitors your primary and read replica.

Local setup

For local environment, spin up the postgres docker containers and Grafana environment including Prometheus via docker-compose.yml

docker-compose up -d

If you just want to run the grafana and prometheus, then you can use the following command:

docker-compose -f docker-compose-grafana.yml up -d

Configuration

Update the file config.yaml file with the connection details of your primary and read replica.

Run the service

Pass the config file as the cli argument:

cargo run -- --config config.yaml

Note: If you are are not using the Local setup via docker-compose, then expose the endpoint http://localhost:8080/metrics as a data source in Grafana to visualize the replication lag and other metrics. (It is already added in the prometheus.yml file for local setup)

Demo

Metrics Endpoint

Metrics Endpoint

Grafana Dashboard

Grafana Dashboard

References:

About

A experimental Rust service/CLI that monitors your primary and read replica.

Resources

License

Stars

Watchers

Forks

Contributors