You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,8 @@ This will build the docker image as `prometheuscommunity/postgres_exporter:${bra
54
54
Use the flag if you don't want to scrape `pg_settings`.
55
55
56
56
*`auto-discover-databases`
57
-
Whether to discover the databases on a server dynamically.
57
+
Whether to discover the databases on a server dynamically. If enabled, each query is run once
58
+
per discovered database. See [Automatically discover databases](#automatically-discover-databases).
58
59
59
60
*`extend.query-path`
60
61
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
@@ -196,6 +197,15 @@ To scrape metrics from all databases on a database server, the database DSN's ca
196
197
`--auto-discover-databases` flag. When true, `SELECT datname FROM pg_database WHERE datallowconn = true AND datistemplate = false and datname != current_database()` is run for all configured DSN's. From the
197
198
result a new set of DSN's is created for which the metrics are scraped.
198
199
200
+
Setting the `master` flag on a metric to `true` disables scraping of each
201
+
discovered database for the metric. The metric will be scraped only once for
202
+
the default database that `postgres_exporter` connects to.
203
+
204
+
For any query that is run on all autodiscovered databases it is **strongly
205
+
recommended** that each metric has the value of `current_database()` mapped as
206
+
a `LABEL` so that it emits distinct dimensions for each database scraped. See
207
+
the examples in `queries.yaml` for details.
208
+
199
209
In addition, the option `--exclude-databases` adds the possibily to filter the result from the auto discovery to discard databases you do not need.
200
210
201
211
If you want to include only subset of databases, you can use option `--include-databases`. Exporter still makes request to
0 commit comments