refactor pg_stat_bgwriter metrics into standalone collector
This moves the metrics that are queried from pg_stat_bgwriter into a dedicated collector instead of dynamically generating queries and metrics from a map. It renames some metrics including adding the `_total` suffix on all of the counters to match prometheus standards. This implementation uses QueryRowContext to allow for later addition of context for cancellation. From the Postgres documentation, it states that there is one line per WAL sender process, but it is unclear how to differentiate between them in any meaningful way. When querying the table, there is no column to identify the row, only metrics about bgwriter. Signed-off-by: Joe Adams <github@joeadams.io>
This commit is contained in:
@@ -41,6 +41,12 @@ This will build the docker image as `prometheuscommunity/postgres_exporter:${bra
|
||||
* `help`
|
||||
Show context-sensitive help (also try --help-long and --help-man).
|
||||
|
||||
* `collector.database`
|
||||
Enable the pg_database collector. Default is `enabled`
|
||||
|
||||
* `collector.bgwriter`
|
||||
Enable the pg_stat_bgwriter collector. Default is `enabled`
|
||||
|
||||
* `web.listen-address`
|
||||
Address to listen on for web interface and telemetry. Default is `:9187`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user