mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-01 22:48:15 +00:00
Add a multi-target example config (#890)
Add an example Prometheus scrape config, similar to the blackbox_exporter's example config. Fixes: https://github.com/prometheus-community/postgres_exporter/issues/888 Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
716ac23f20
commit
04bb60ce31
20
README.md
20
README.md
@ -30,6 +30,26 @@ To use the multi-target functionality, send an http request to the endpoint `/pr
|
||||
|
||||
To avoid putting sensitive information like username and password in the URL, preconfigured auth modules are supported via the [auth_modules](#auth_modules) section of the config file. auth_modules for DSNs can be used with the `/probe` endpoint by specifying the `?auth_module=foo` http parameter.
|
||||
|
||||
Example Prometheus config:
|
||||
```yaml
|
||||
scrape_configs:
|
||||
- job_name: 'postgres'
|
||||
static_configs:
|
||||
- targets:
|
||||
- server1:5432
|
||||
- server2:5432
|
||||
metrics_path: /probe
|
||||
params:
|
||||
auth_module: [foo]
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: 127.0.0.1:9116 # The postgres exporter's real hostname:port.
|
||||
```
|
||||
|
||||
## Configuration File
|
||||
|
||||
The configuration file controls the behavior of the exporter. It can be set using the `--config.file` command line flag and defaults to `postgres_exporter.yml`.
|
||||
|
Loading…
Reference in New Issue
Block a user