A Prometheus exporter that exports the size of directories.
This Prometheus exporter, allows to export directory sizes as Prometheus metrics.
This exporter will export metrics in the following format:
directory_size_bytes{path="/path/to/your/directory",name="directory"} <size_in_bytes>
The recommended way to use this exporter is with Docker.
docker run --rm -p 8080:8080 -v /var:/mnt/var ghcr.io/brpaz/prom-dirsize-exporter:latest --directories /mnt/var
Important
When using Docker, ensure that directories you want to measure are mounted in the container as a volume.
The exporter can be configured using both command line flags or envrionment variables. Any command line flag will take precedence over envrionment variables.
Below you can find a list of supported configurations:
Name | Flag | Environment variable | Default value | Description |
---|---|---|---|---|
Port | --metrics-port |
METRICS_PORT |
8080 |
The port that the exporter listens to. |
Directories to monitor | --directories |
DIRECTORIES |
[] |
A list of directory paths to monitor, separated by ":". |
Metrics Path | --metrics-path |
METRICS_PATH |
/metrics |
The path where the metrics are exposed. |
All contributions are welcome. Please check Contributing guide for instructions howe to contribute to this project.
If you find this project helpful and would like to support its development, there are a few ways you can contribute:
👤 Bruno Paz
- Website: brunopaz.dev
- Github: @brpaz
Copyright Bruno Paz.
This project is MIT licensed.