A Prometheus exporter for Borg backups.
It provides the following metrics:
Name | Description | Type |
---|---|---|
borg_backups_total | Total number of Borg backups | Gauge |
borg_last_backup_timestamp | Timestamp of the last backup | Gauge |
borg-exporter makes use of borgmatic (https://github.com/witten/borgmatic) to fetch the state of backups.
The two mostly used options to install borgmatic
- From your distro's package manager
- Statically compiled python binary: https://github.com/danihodovic/borgmatic-binary
Also, the exporter assumes that borgmatic is already configured and enabled.
Refer to the official borgmatic documentation
Borg exporter runs as a Python binary managed by Systemd. It provides a command to bootstrap into a simple systemd service.
To install the binary from Github:
curl -L https://github.com/danihodovic/borg-exporter/releases/download/latest/borg-exporter -o ./borg-exporter
chmod +x borg-exporter
sudo mv ./borg-exporter /usr/local/bin/
sudo borg-exporter enable-systemd
Alerting rules can be found here. By default Prometheus sends an alert if a backup hasn't been issued in 24h5m.
You can find the generated Grafana dashboard here and it can be imported directly into the Grafana UI.
It's also available in Grafana's Dashboard Library.