1
0
mirror of https://github.com/pavel-v-sobolev/pg_probackup_exporter.git synced 2026-06-18 21:35:20 +02:00
2025-04-10 08:58:05 +03:00
2025-04-09 19:05:23 +03:00
2025-04-09 19:06:53 +03:00
2025-04-10 08:58:05 +03:00

pg_probackup_exporter

Postgres pg_probackup prometheus metrics exporter. This is a tool for monitoring postgresql backups. It exports pg_probackup metrics as a web service in prometheus format.

Installation

  1. download pg_probackup_exporter.py and put to your folder. E.g. /usr/local/bin
  2. install python flask library. For ubuntu: sudo apt install python3-flask
  3. set environment variables and run the program with the following command: python3 /usr/local/bin/pg_probackup_exporter.py

You need to set 3 environment vars:

  1. path to your pg_probackup executable e.g. PG_PROBACKUP_COMMAND = '/usr/bin/pg_probackup-17'
  2. web service port, default 9899 PG_PROBACKUP_EXPORTER_PORT = '9899'
  3. path to backup folder e.g. PG_PROBACKUP_PATH = '/mnt/backup'

Metrics are available under http://your_host:port/metrics

Example service file for ubuntu linux:
sudo nano /etc/systemd/system/pg_probackup_exporter.service

[Service]
Type=simple
User=postgres
Group=postgres
Environment=PG_PROBACKUP_COMMAND='/usr/bin/pg_probackup-17'
Environment=PG_PROBACKUP_PATH='/mnt/backup'

ExecStart=/usr/bin/python3 /usr/local/bin/pg_probackup_exporter.py
KillMode=control-group
TimeoutSec=5
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Example for prometheus config
scrape_configs:
- job_name: pg_probackup
scrape_interval: 30s
scrape_timeout: 30s
scheme: http
static_configs:
- targets: ["10.8.200.138:9899"]
labels:
"service": "postgres"
"instance": "pg_master"
"host": "10.8.200.138"
"Business_Critical": "Medium"
"Team": "Postgres"

S
Description
No description provided
Readme GPL-3.0 54 KiB
Languages
Python 100%