A very simple Borg exporter for Prometheus. This exporter is mostly useful for getting the days since the last backup was made and the sizes of the backups in total.
- python
- prometheus_client
Run the exporter
python prometheus-borg-exporter.py
The default port is 9099, visit metrics [http://localhost:9099/ http://localhost:9099/].
The backup directory's can be configured in borg.yml with the backups directories in the 'dirs' list. The metrics use the basename of the directory as the "backup host".
- name: backup
interval: 60s
rules:
- alert: backup
expr: borg_last_modified > 5
for: 20m
labels:
severity: warning
annotations:
description: 'host {{ $labels.instance }} has outdated backups'
summary: '{{ $labels.instance }} backups are {{ $value }} days old'
There is no support for decrypting the backups.