Skip to content

Commit 04bb60c

Browse files
authored
Add a multi-target example config (prometheus-community#890)
Add an example Prometheus scrape config, similar to the blackbox_exporter's example config. Fixes: prometheus-community#888 Signed-off-by: SuperQ <[email protected]>
1 parent 716ac23 commit 04bb60c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ To use the multi-target functionality, send an http request to the endpoint `/pr
3030

3131
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.
3232

33+
Example Prometheus config:
34+
```yaml
35+
scrape_configs:
36+
- job_name: 'postgres'
37+
static_configs:
38+
- targets:
39+
- server1:5432
40+
- server2:5432
41+
metrics_path: /probe
42+
params:
43+
auth_module: [foo]
44+
relabel_configs:
45+
- source_labels: [__address__]
46+
target_label: __param_target
47+
- source_labels: [__param_target]
48+
target_label: instance
49+
- target_label: __address__
50+
replacement: 127.0.0.1:9116 # The postgres exporter's real hostname:port.
51+
```
52+
3353
## Configuration File
3454
3555
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`.

0 commit comments

Comments
 (0)