diff --git a/collector/textfile.go b/collector/textfile.go index 2f19d018..47d17716 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -64,7 +64,7 @@ type textFileCollector struct { func newTextFileCollectorFlags(app *kingpin.Application) { textFileDirectory = app.Flag( FlagTextFileDirectory, - "Directory or Directories to read text files with metrics from.", + "DEPRECATED: Use --collector.textfile.directories", ).Default("").String() textFileDirectories = app.Flag( FlagTextFileDirectories, diff --git a/docs/collector.textfile.md b/docs/collector.textfile.md index 6bb02a20..75d1e5ff 100644 --- a/docs/collector.textfile.md +++ b/docs/collector.textfile.md @@ -10,15 +10,25 @@ Enabled by default? | Yes ## Flags -### `--collector.textfile.directory` +### `--collector.textfile.directory` +:warning: DEPRECATED Use `--collector.textfile.directories` -The directory containing the files to be ingested. Only files with the extension `.prom` are read. The `.prom` file must end with an empty line feed to work properly. +
+ +### `--collector.textfile.directories` +One or multiple directories containing the files to be ingested. + +E.G. `--collector.textfile.directories="C:\MyDir1,C:\MyDir2"` Default value: `C:\Program Files\windows_exporter\textfile_inputs` Required: No -## Metrics +> **Note:** +> - If there are duplicated filenames among the directories, only the first one found will be read. For any other files with the same name, the `windows_textfile_scrape_error` metric will be set to 1 and a error message will be logged. +> - Only files with the extension `.prom` are read. The `.prom` file must end with an empty line feed to work properly. + + Metrics will primarily come from the files on disk. The below listed metrics are collected to give information about the reading of the metrics themselves. @@ -38,7 +48,7 @@ _This collector does not yet have any useful queries added, we would appreciate _This collector does not yet have alerting examples, we would appreciate your help adding them!_ # Example use -This Powershell script, when run in the `collector.textfile.directory` (default `C:\Program Files\windows_exporter\textfile_inputs`), generates a valid `.prom` file that should successfully ingested by windows_exporter. +This Powershell script, when run in the `--collector.textfile.directories` (default `C:\Program Files\windows_exporter\textfile_inputs`), generates a valid `.prom` file that should successfully ingested by windows_exporter. ```Powershell $alpha = 42