Sign inSign up

fishgrimsby/borgmatic-exporter

By fishgrimsby

•Updated 29 days ago

A metrics exporter for Borgmatic backups written in Go that can be scraped by Prometheus.

Image
Monitoring & observability
2

7.1K

fishgrimsby/borgmatic-exporter repository overview

⁠Borgmatic-exporter

Source code available at: https://github.com/fishgrimsby/borgmatic-exporter⁠

⁠To run interactively:

docker run -it --rm --name borgmatic-exporter -p 8090:8090 fishgrimsby/borgmatic-exporter:latest

⁠To run as daemon (with mounts):

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

⁠Docker Compose

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

⁠To access:

Once the docker container is running visit http://localhost:8090/metrics⁠

Then run docker compose up -d from the same directory

Tag summary

Content type

Image

Digest

sha256:9fa4325bd…

Size

55.5 MB

Last updated

29 days ago

docker pull fishgrimsby/borgmatic-exporter