Commit Graph

9 Commits

Author SHA1 Message Date
Joe Adams ab33346cbd
Add the instance struct to handle connections
The intent is to use the instance struct to hold the connection to the database as well as metadata about the instance. Currently this metadata only includes the version of postgres for the instance which can be used in the collectors to decide what query to run. In the future this could hold more metadata but for now it keeps the Collector interface arguments to a reasonable number.

Signed-off-by: Joe Adams <github@joeadams.io>
2023-06-21 20:36:59 -04:00
Felix Yuan fe960c6b54
Move queries from queries.yaml to collectors (#801)
Signed-off-by: Ben Kochie <superq@gmail.com>
2023-06-08 23:28:04 +02:00
SuperQ de1c3cc5e7
Update exporter-toolkit
Updates the exporter-toolkit to the latest version
* Adds new landing page feature.
* Allow metrics path to be on `/`.

Signed-off-by: SuperQ <superq@gmail.com>
2023-03-21 08:23:23 +01:00
Joe Adams 799f3e15b2 Fix exclude-databases for collector package
The pg_database collector was not respecting the --exclude-databases flag and causing problems where databases were not accessible. This now respects the list of databases to exclude.

- Adjusts the Collector create func to take a config struct instead of a logger. This allows more changes like this in the future. I figured we would need to do this at some point but I wasn't sure if we could hold off.
- Split the database size collection to a separate query when database is not excluded.
- Comment some probe code that was not useful/accurate

Signed-off-by: Joe Adams <github@joeadams.io>
2023-03-05 15:13:00 -05:00
Joe Adams 713461df98 WIP: Add prelim multi-target support
- Remove multi server support from new collector package
- Add http handler for multi-target support

Signed-off-by: Joe Adams <github@joeadams.io>
2022-07-28 10:19:32 -04:00
Joe Adams 9704b9fb2e
Clean up autoDiscoverDatabases in the new collector
Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-25 08:11:22 -05:00
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