Skip to content

Commit

Permalink
readme & text changes
Browse files Browse the repository at this point in the history
Signed-off-by: Dinifarb <[email protected]>
  • Loading branch information
DiniFarb committed Aug 21, 2023
1 parent 0ec4e9d commit 9473265
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion collector/textfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 14 additions & 4 deletions docs/collector.textfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<br>

### `--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.
Expand All @@ -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
Expand Down

0 comments on commit 9473265

Please sign in to comment.