{"id":28305749,"url":"https://github.com/maxim-mityutko/borgmatic-exporter","last_synced_at":"2025-12-28T06:06:16.309Z","repository":{"id":217955059,"uuid":"744770647","full_name":"maxim-mityutko/borgmatic-exporter","owner":"maxim-mityutko","description":"Prometheus exporter for Borgmatic seamlessly integrated into official Borgmatic docker image","archived":false,"fork":false,"pushed_at":"2025-08-01T11:58:05.000Z","size":773,"stargazers_count":10,"open_issues_count":5,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T12:54:02.791Z","etag":null,"topics":["backup","borgmatic","docker","exporter","grafana","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxim-mityutko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-18T01:03:15.000Z","updated_at":"2025-08-01T11:58:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f7cf530-7992-4d4c-9bb7-f539add402e5","html_url":"https://github.com/maxim-mityutko/borgmatic-exporter","commit_stats":{"total_commits":24,"total_committers":7,"mean_commits":"3.4285714285714284","dds":0.5416666666666667,"last_synced_commit":"61e6de01009b279bf60046d3dcb24a7bd52ed024"},"previous_names":["maxim-mityutko/borgmatic-exporter"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/maxim-mityutko/borgmatic-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim-mityutko%2Fborgmatic-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim-mityutko%2Fborgmatic-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim-mityutko%2Fborgmatic-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim-mityutko%2Fborgmatic-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxim-mityutko","download_url":"https://codeload.github.com/maxim-mityutko/borgmatic-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim-mityutko%2Fborgmatic-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271887761,"owners_count":24839139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","borgmatic","docker","exporter","grafana","prometheus","prometheus-exporter"],"created_at":"2025-05-24T02:13:16.786Z","updated_at":"2025-12-28T06:06:16.303Z","avatar_url":"https://github.com/maxim-mityutko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Borgmatic Exporter\n\n![Super-Linter](https://github.com/maxim-mityutko/borgmatic-exporter/actions/workflows/build.yml/badge.svg)\n![GitHub last commit (branch)](https://img.shields.io/github/last-commit/maxim-mityutko/borgmatic-exporter/master)\n![Static Badge](https://img.shields.io/badge/Borgmatic%20Image-v2.0.12-green)\n\n**Borgmatic Exporter** seamlessly integrates Prometheus metrics and Borgmatic. This project is based on\nthe [borg-exporter](https://github.com/danihodovic/borg-exporter) by [@danihodovic](https://github.com/danihodovic),\nhowever it introduces a few changes:\n\n- extra metrics\n- native integration with the official Borgmatic docker image\n\n## Metrics\n\n| Name                                          | Type  |\n|-----------------------------------------------|-------|\n| borg_total_backups                            | Gauge |\n| borg_total_chunks                             | Gauge |\n| borg_total_size                               | Gauge |\n| borg_total_compressed_size                    | Gauge |\n| borg_total_deduplicated_size                  | Gauge |\n| borg_total_deduplicated_compressed_size       | Gauge |\n| borg_last_backup_timestamp                    | Gauge |\n| borg_last_backup_duration                     | Gauge |\n| borg_last_backup_files                        | Gauge |\n| borg_last_backup_deduplicated_compressed_size | Gauge |\n| borg_last_backup_compressed_size              | Gauge |\n| borg_last_backup_size                         | Gauge |\n\n## Installation\n\n### Docker\n\nRecommended way of using **Borgmatic Exporter** is through Docker. The image\nis based on the official [docker-borgmatic](https://github.com/borgmatic-collective/docker-borgmatic)\nimage, and it seamlessly integrates Prometheus metrics into the distribution by running both Borgmatic\nentrypoint and exporter server in parallel. All images are available\n[here](https://github.com/maxim-mityutko/borgmatic-exporter/pkgs/container/borgmatic-exporter).\n\n```shell\ndocker pull ghcr.io/maxim-mityutko/borgmatic-exporter:latest\n```\n\n1. Configure Borgmatic: \u003chttps://github.com/borgmatic-collective/docker-borgmatic/blob/master/README.md\u003e\n2. Configure Borgmatic Exporter:\n\n    **Borgmatic Exporter** supports the following environment variables for customization:\n\n    | Name                    | Description                                                 | Default                     |\n    |-------------------------|-------------------------------------------------------------|-----------------------------|\n    | BORGMATIC_CONFIG        | One or multiple references to Borgmatic configuration files | /etc/borgmatic.d/config.yml |\n    | BORGMATIC_EXPORTER_HOST | Host for the metrics server                                 | 0.0.0.0                     |\n    | BORGMATIC_EXPORTER_PORT | Port for the metrics server                                 | 9996                        |\n    | BORGMATIC_EXPORTER_TIME | Display time each Borgmatic call takes                      | false                       |\n\n#### Notes\n\n- Use colon (`:`) if multiple configs should be provided through the environment variable `BORGMATIC_CONFIG`,\n    e.g. `/etc/borgmatic/config_1.yml:/etc/borgmatic/config_2.yml`\n- If **keyfiles** need to provided to Borgmatic Exporter, mount the volume containing the keys to both `/root/.config/borg`\n    and to `/tmp/borgmatic-exporter-cache/.config/borg` (ref: [#43](https://github.com/maxim-mityutko/borgmatic-exporter/issues/43))\n\n### Local\n\nInstall and configure [borgmatic](https://github.com/witten/borgmatic) by following the instructions in the\nofficial repository, then install **Borgmatic Exporter**\n\n```shell\ngit clone https://github.com/maxim-mityutko/borgmatic-exporter.git\npip install -Ur requirements.txt\npython3 cli.py run -c \u003cpath-to-your-borgmatic-config-yml\u003e\n```\n\n## Observability and Monitoring\n\n### Grafana\n\n* Global view\n![dashboard.png](observability%2Fdashboard-global.png)\n- Repository details view\n![dashboard.png](observability%2Fdashboard-details.png)\nDashboard is available in the [repo](/observability/grafana-dashboard.json) or on\n[Grafana's Dashboard Library](https://grafana.com/grafana/dashboards/20334).\n\n### Alerts\n\nAlerting rules can be found [here](observability%2Fprometheus-alert.yaml). By default alert will\nbe triggered if there is no backup for repository within 25 hours.\n\n## Development\n\n### Local Environment\n\n- Install [Poetry](https://python-poetry.org)\n- Use provided `Makefile` to setup environment: `make dev`\n- Run tests: `make test`\n\n### Docker\n\n* Build and run\n\n    ```shell\n    docker build -t borgmatic:tag .\n    docker run --name borgmatic borgmatic:tag\n    ```\n\n* Rename or remove existing container, if the same name is already in use\n\n    ```shell\n    docker container ls -a\n    docker container rm container-id\n    ```\n\n* Exec into the container and create config\n\n    ```shell\n    docker exec -it borgmatic /bin/sh\n    \n    borgmatic config generate\n    \n    # The default config will have entries for both remote and local repo\n    # Remote repo config should be commented before proceeding\n    vi /etc/borgmatic/config.yaml\n    \n    borgmatic init --encryption repokey\n    ```\n\n* Misc\n\n    ```shell\n    # Output repo info in JSON format\n    borgmatic info --json --last 1\n    # Create backup\n    borgmatic create\n    # Run exporter\n    python3 cli.py run --config /etc/borgmatic/config.yaml\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim-mityutko%2Fborgmatic-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxim-mityutko%2Fborgmatic-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim-mityutko%2Fborgmatic-exporter/lists"}