Commit Graph

3 Commits

Author SHA1 Message Date
Joe Adams
27d23d02ef
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>
2022-02-22 21:46:43 -05:00
Joe Adams
9dad33c397
Comment unused var
Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-14 21:14:17 -05:00
Joe Adams
c3b0206369
Add collector interface
Uses node_exporter style collector registration

Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-14 21:12:27 -05:00