From c30c860724be7dbf7edaba08ae1273afa54ec3d5 Mon Sep 17 00:00:00 2001 From: Hector <dev@hsmith.org> Date: Tue, 12 Oct 2021 21:22:18 +0100 Subject: [PATCH] update readme --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 8c0c592..c3d06c8 100644 --- a/README.md +++ b/README.md @@ -240,3 +240,24 @@ fail2ban_errors{type="db"} 0 # TYPE fail2ban_up gauge fail2ban_up 1 ``` + +### 4.3. Textfile Metrics + +For more flexibility the exporter also allows exporting metrics collected from a text file. + +To enable textfile metrics: +1. Enable the collector with `-collector.textfile=true` +2. Provide the directory to read files from with the `-collector.textfile.directory` flag + +Metrics collected from these files will be exposed directly alongside the other metrics without any additional processing. +This means that it is the responsibility of the file creator to ensure the format is correct. + +By exporting textfile metrics, an extra metric is also exported with an error count for each file: + +``` +# HELP textfile_error Checks for errors while reading text files +# TYPE textfile_error gauge +textfile_error{path="file.prom"} 0 +``` + +**NOTE:** Only files ending with `.prom` will be considered.