update readme

This commit is contained in:
Hector 2021-10-12 21:22:18 +01:00
parent eedd7e6074
commit c30c860724

View File

@ -240,3 +240,24 @@ fail2ban_errors{type="db"} 0
# TYPE fail2ban_up gauge # TYPE fail2ban_up gauge
fail2ban_up 1 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.