Skip to content

Commit

Permalink
Add a multi-target example config (#890)
Browse files Browse the repository at this point in the history
Add an example Prometheus scrape config, similar to the
blackbox_exporter's example config.

Fixes: #888

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ authored Aug 15, 2023
1 parent 716ac23 commit 04bb60c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 04bb60c

Please sign in to comment.