Prometheus exporter that scans for certain files in directories
GPL-3.0 License
A Prometheus exporter that watches directories on the local filesystem
🔍 Watches multiple dirs and their files for changes 🎯 Filters can be supplied that both in- or exclude files / subdirectories 🔭 Directory information is exposed as Prometheus metrics
Get alerted ⚠️ when a directory contains files / subdirectories that should not be there 👻 when a directory does not contain files / subdirectories that should be there 💥 when the size of an object does not lie within a given threshold
$ git clone https://github.com/soerenschneider/directory-exporter.git
$ cd directory-exporter
$ docker run -v $(pwd)/contrib:/config ghcr.io/soerenschneider/directory-exporter:main -config /config/directory-exporter.json
Head over to the prebuilt binaries and download the correct binary for your system.
As a prerequisite, you need to have Golang SDK installed. After that, you can install directory-exporter from source by invoking:
$ go install github.com/soerenschneider/directory-exporter@latest
A minimal example can be found here.
To read about the configuration options, head over to the configuration section
All metrics are prefixed with directory_exporter
Name | Type | Labels | Help |
---|---|---|---|
file_count_total | GaugeVec | dir | The total number of files found recursively under given directory |
file_size_bytes | GaugeVec | dir | The size of all files that have been included or not been excluded |
dir_size_bytes | Counters | dir | The size of all files in the directory, even excluded files |
excluded_files_total | GaugeVec | dir | The total number of excluded files under given directory |
errors_total | GaugeVec | dir | Errors while trying to access a directory |
files_next_scan_timestamp_seconds | GaugeVec | dir | Timestamp when next scan for given dir is started |
files_scan_process_seconds | GaugeVec | dir | Seconds taken to scan given directory |
heartbeat_seconds | Gauge | - | Continuous heartbeat of the exporter |
The changelog can be found here