mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Add configuration file documentation
Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
30
README.md
30
README.md
@@ -136,6 +136,36 @@ The prometheus metrics will be exposed on [localhost:9182](http://localhost:9182
|
||||
|
||||
When there are multiple processes with the same name, WMI represents those after the first instance as `process-name#index`. So to get them all, rather than just the first one, the [regular expression](https://en.wikipedia.org/wiki/Regular_expression) must use `.+`. See [process](docs/collector.process.md) for more information.
|
||||
|
||||
### Using a configuration file
|
||||
|
||||
YAML configuration files can be specified with the `--config.file` flag. E.G. `.\windows_exporter.exe --config.file=config.yml`
|
||||
|
||||
```yaml
|
||||
collectors:
|
||||
enabled: cpu,cs,net,service
|
||||
collector:
|
||||
service:
|
||||
services-where: "Name='windows_exporter'"
|
||||
log:
|
||||
level: warn
|
||||
```
|
||||
|
||||
An example configuration file can be found [here](docs/example_config.yml).
|
||||
|
||||
#### Configuration file notes
|
||||
|
||||
If the `--config.file` flag is not specified, `windows_exporter` will look for a file located at `%programfiles\windows_exporter\config.yml` by default. If no file is found, CLI flags are processed as per normal.
|
||||
|
||||
Configuration file values can be mixed with CLI flags. E.G.
|
||||
|
||||
`.\windows_exporter.exe --collectors.enabled=cpu,logon`
|
||||
|
||||
```yaml
|
||||
log:
|
||||
level: debug
|
||||
```
|
||||
|
||||
CLI flags enjoy a higher priority over values specified in the configuration file.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
15
docs/example_config.yml
Normal file
15
docs/example_config.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# Note this is not an exhaustive list of all configuration values
|
||||
collectors:
|
||||
enabled: cpu,cs,logical_disk,net,os,service,system,textfile
|
||||
collector:
|
||||
service:
|
||||
services-where: Name='windows_exporter'
|
||||
log:
|
||||
level: debug
|
||||
scrape:
|
||||
timeout-margin: 0.5
|
||||
telemetry:
|
||||
addr: ":9182"
|
||||
path: /metrics
|
||||
max-requests: 5
|
||||
Reference in New Issue
Block a user