https://github.com/timtorchen/rustic-exporter
Prometheus exporter for rustic/restic backup
https://github.com/timtorchen/rustic-exporter
metrics prometheus-exporter restic-exporter rust rustic-exporter
Last synced: 4 months ago
JSON representation
Prometheus exporter for rustic/restic backup
- Host: GitHub
- URL: https://github.com/timtorchen/rustic-exporter
- Owner: timtorChen
- License: mit
- Created: 2024-09-27T07:58:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-19T07:12:35.000Z (4 months ago)
- Last Synced: 2026-02-19T12:39:20.804Z (4 months ago)
- Topics: metrics, prometheus-exporter, restic-exporter, rust, rustic-exporter
- Language: Rust
- Homepage:
- Size: 778 KB
- Stars: 5
- Watchers: 0
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rustic-exporter
... _progressing slowly with [Look at Yourself](https://www.youtube.com/watch?v=tcq6qZOE03c)_ 🎧
[](https://codecov.io/gh/timtorChen/rustic-exporter)
[](https://github.com/timtorChen/rustic-exporter/releases/latest)
[](https://github.com/timtorChen/rustic-exporter/pkgs/container/rustic-exporter)
---
⚠️ This project is still under development; use it with caution.
Prometheus exporter for rustic/restic backup.

### Background
Originally I would like to craft a restic-exporter supporting multiple backup repositories because of the [issue](https://github.com/ngosang/restic-exporter/issues/26#issuecomment-1915364225). After checking the code, I found restic do not separate its library from the CLI. This forces downstream user to rely on subprocess binary calls, which causes additional maintaince overhead. So, I switched gears to rustic, and started this project.
### Requirements
The backup client should use `restic >= v0.17`, or metrics like `rustic_snapshot_size_bytes` will be dropped.
### Usage
#### Command line
```
Usage: rustic-exporter [OPTIONS] --config
Options:
-i, --interval Metrics collection frequency in seconds [default: 300]
--log-level Log level: debug, info, warn, error [default: info]
-v, --verbose Show logs of all dependents
-c, --config Path to the configuration file
--host Server host [default: 0.0.0.0]
--port Server port [default: 8080]
-h, --help Print help
-V, --version Print version
```
#### Configuration file
The configuration file is in TOML format, and follows the rustic [supported services](https://rustic.cli.rs/docs/commands/init/services.html).
```toml
# Local
[[backup]]
repository = "./local"
password = "test"
[backup.options]
# Opendal
## S3 backend
[[backup]]
repository = "opendal:s3"
password = "test"
[backup.options]
## set opendal S3 backend configuration in the form of key-value
## https://opendal.apache.org/docs/rust/opendal/services/struct.S3.html#configuration
endpoint = "https://s3.west-2.amazonaws.com"
access_key_id = "access-key-id"
secret_access_key = "secret-access-key"
bucket = "bucket-name"
root = "/"
region = "auto"
## Google Drive backend
[[backup]]
repository = "opendal:gdrive"
password = "test"
[backup.options]
## set opendal GoogleDrive backend configuration
## https://opendal.apache.org/docs/rust/opendal/services/struct.Gdrive.html
access_token = "access-token"
refresh_token = "refresh-token"
client_id = "client-id"
client_secret = "client-secret"
```