prometheus-borgmatic-exporter
A Prometheus metrics exporter for borgmatic, designed to be run via a systemd timer and consumed by the node exporter textfile collector.
Requirements
- Python 3.11+
- borgmatic
Installation
pip install prometheus-borgmatic-exporter
Usage
Usage: prometheus-borgmatic-exporter [OPTIONS]
Collect borgmatic repository metrics and export them for Prometheus.
Queries borgmatic for repository and archive statistics and writes them
to a .prom file for consumption by the Prometheus node exporter textfile
collector.
By default only the latest archive is queried per repository. Use
--all-archives to collect metrics for every archive, at the cost of
a significantly longer runtime.
Using --all-archives will create one time series per archive and may
significantly increase Prometheus storage usage.
Options:
--borgmatic-bin PATH Path to the borgmatic executable.
[default: /usr/bin/borgmatic]
--borgmatic-config PATH Configuration file or directory. Can be
specified multiple times. If not
specified, borgmatic's default
configuration discovery is used.
--textfile-collector-dir PATH Directory where the Prometheus collector
textfile file will be written.
[default: /var/lib/prometheus/node-exporter]
--all-archives Collect metrics for all archives instead
of only the latest archive. This can
significantly increase runtime and
Prometheus storage usage.
-q, --quiet Suppress all non-error output.
-v, --verbose Enable verbose output.
--version Show version information and exit.
--color [auto|always|never] Colorize the output. A bare --color is
the same as --color=always.
[default: auto]
--no-color Disable colorization (alias of
--color=never).
-h, --help, -? Show this message and exit.
Metrics
All metrics carry the labels repository_id, repository_label, and location.
Repository metrics
| Metric | Description |
|---|---|
borg_total_chunks |
Total number of chunks across all archives |
borg_total_compressed_size_bytes |
Total compressed size of all chunks |
borg_total_original_size_bytes |
Total original size of all chunks |
borg_total_unique_chunks |
Number of unique chunks (deduplicated) |
borg_total_deduplicated_compressed_size_bytes |
Compressed size of unique chunks |
borg_total_deduplicated_size_bytes |
Original size of unique chunks |
borg_last_modified_timestamp_seconds |
Unix timestamp of last repository modification |
borg_archives |
Total number of archives in the repository |
borg_repository_encryption_info |
Encryption mode as an info metric |
Latest archive metrics
| Metric | Description |
|---|---|
borg_latest_archive_compressed_size_bytes |
Compressed size of the latest archive |
borg_latest_archive_deduplicated_size_bytes |
Deduplicated size of the latest archive |
borg_latest_archive_files_total |
Number of files in the latest archive |
borg_latest_archive_original_size_bytes |
Original size of the latest archive |
borg_latest_archive_duration_seconds |
Duration of the latest archive creation |
Per-archive metrics (--all-archives only)
These metrics additionally carry archive_id and archive_name labels.
| Metric | Description |
|---|---|
borg_archive_compressed_size_bytes |
Compressed size of the archive |
borg_archive_deduplicated_size_bytes |
Deduplicated size of the archive |
borg_archive_files_total |
Number of files in the archive |
borg_archive_original_size_bytes |
Original size of the archive |
borg_archive_duration_seconds |
Duration of the archive creation |
License
BSD-3-Clause. See LICENSE for details.
Metadata
Release files for prometheus-borgmatic-exporter 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prometheus_borgmatic_exporter-2.0.1.tar.gz | 19.4 kB | Without provenance | Details for prometheus_borgmatic_exporter-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prometheus_borgmatic_exporter-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for prometheus_borgmatic_exporter-2.0.1-py3-none-any.whl |
Total release size: 32.2 kB
Release files / prometheus_borgmatic_exporter-2.0.1.tar.gz
| Download URL | prometheus_borgmatic_exporter-2.0.1.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74421036e454b95dc8190e88f4dbe63f71196978962587091c9b98fd38cdea8d
|
|
BLAKE2b-256 checksum How to use checksums |
3ba5c92c857a7f228c295122ddc4d017eae19183d55b4aa90b62626b6a085390
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / prometheus_borgmatic_exporter-2.0.1-py3-none-any.whl
| Download URL | prometheus_borgmatic_exporter-2.0.1-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54de7183595b57818f5d68de318d5a9bc0f7f97632e78b5f02e506ea29749ce1
|
|
BLAKE2b-256 checksum How to use checksums |
d103d3816a2661167f8d86724e83fa8c4cd39b56f53f554b4f76f415226e65de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Security for prometheus-borgmatic-exporter 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.