Prometheus exporter providing size and age metrics about files.
Example installation on Debian / Ubuntu:
# required for creating Python virtualenvs:
apt update
apt install -y python3-venv
# create a virtualenv in /opt:
python3 -m venv /opt/fsa-metrics
# update 'pip' and install the 'file-size-age-metrics' package:
/opt/fsa-metrics/bin/pip install --upgrade pip
/opt/fsa-metrics/bin/pip install file-size-age-metrics
This is mostly relevant for testing configuration settings and checking if the
exporter works as expected - to do this either activate the previously created
Python environment or call the fsa-metrics
script using the full path to that
environment.
A configuration file is required for running the metrics exporter. Simply copy
the config-example.yaml file to e.g. config.yaml
and adjust the settings
there. Then run the exporter like this:
fsa-metrics --config config.yaml
The exporter running in foreground can be terminated as usual via Ctrl+C
.
FIXME!
Currently only a single directory tree can be monitored. Adding support for monitoring several trees with a single process is planned though.
The exporter is designed with code simplicity as a goal, it's not optimized for efficiency or low resource usage. A few numbers on an average laptop running the exporter on a rather large file tree (not recommended, just for demonstration purposes):
- Number of files monitored: ~200'000
- Memory consumption: ~350 MB
- Metrics collection duration: < 10s