A metrics exporter for Borgmatic backups written in Go that can be scraped by Prometheus.
7.0K
Source code available at: https://github.com/fishgrimsby/borgmatic-exporter
docker run -it --rm --name borgmatic-exporter -p 8090:8090 fishgrimsby/borgmatic-exporter:latest
docker run -d --name borgmatic-exporter -p 8090:8090 -v /etc/borgmatic:/etc/borgmatic -v /path/to/source_directory:/path/to/source_directory fishgrimsby/borgmatic-exporter:latest
Ensure you replace the volume mounts above with appropriate ones for your system, ensuring the path to your borgmatic config(s) is mounted and any paths from your config's source_directories and repositories (if local) are also mounted in the expected locations. If using remote repositories, ensure any necessary keys are also mounted into the container so that they can be accessed.
Environment variables can also be set. I.e to override the config path:
docker run -d --name borgmatic-exporter -p 8090:8090 -e BORGMATIC_EXPORTER_CONFIG=/my/path/to/borgmatic/config.yaml -v /my/path/to/borgmatic:/my/path/to/borgmatic -v /path/to/source_directory:/path/to/source_directory fishgrimsby/borgmatic-exporter:latest
Configure a docker-compose.yaml file with the following contents, replacing volume mount paths (i.e source directories) as appropriate:
---
version: "2.1"
services:
borgmatic-exporter:
image: fishgrimsby/borgmatic-exporter:latest
container_name: borgmatic-exporter
volumes:
- /etc/borgmatic:/etc/borgmatic:ro
- /source/directory1:/source/directory1:ro
- /source/directory2:/source/directory2:ro
- /root/.ssh:/root/.ssh:ro
ports:
- 8090:8090
restart: always
Once the docker container is running visit http://localhost:8090/metrics
Then run docker compose up -d from the same directory
Content type
Image
Digest
sha256:9fa4325bd…
Size
55.5 MB
Last updated
22 days ago
docker pull fishgrimsby/borgmatic-exporter