/prom-dirsize-exporter

A Prometheus exporter for directory sizes

Primary LanguageGoMIT LicenseMIT

prom-dirsize-exporter

A Prometheus exporter that exports the size of directories.

Go version Go Report Card Latest Release GitHub Workflow Status Codecov License

About

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>

Usage

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.

Configuration

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.

Contributing

All contributions are welcome. Please check Contributing guide for instructions howe to contribute to this project.

🫶 Support

If you find this project helpful and would like to support its development, there are a few ways you can contribute:

Sponsor me on GitHub

Buy Me A Coffee

Built With

Author

👤 Bruno Paz

📝 License

Copyright Bruno Paz.

This project is MIT licensed.