You give a list to this exporter and it reads first line of the file if it exists.
If the first line can be converted to integer then it's exported.
pip3 install prometheus-file-content-exporter
This will give you prometheus-file-content-exporter
command line that you can run.
Exporter need yaml
as configuration.
You can specify path to config via environment variable EXPORTER_CONFIG
.
You can configure port on which it is exposed by environment variable EXPORTER_PORT
In configuration file you need a list of files. Those files will be watched.
Example:
# The list of file to get content from
files:
- /var/svn/main/db/current
- /tmp/test
file_content_tmp_test{file="/tmp/test"} 1123.0
- Release new version on GitHub
- Update version in
setup.py
- Run
python3 setup.py sdist upload -r pypi
This software is released under the MIT license.