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
Ben Kochie 99828de70a
Fix up collector registration (#812)
Use const definitions to make collector registration consistent.
* Use collector subsystem name consistently.
* Fix up replication metric name unit.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-13 17:28:11 +02: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 425c4938ef
Refactor collector descriptors
Use individual collector metric descriptor vars to help avoid
miss-mapped or unused metrics.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-01 10:04:35 +02: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 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
Joe Adams 1981623d9d
Add missing server label
Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-09 21:56:48 -05:00
Joe Adams 21a19ed252
Add pg_database collector
Converts the pg_database metrics from queries.yaml to a built in collector. This is enabled by default because it is not likely to be a performance problem and likely very useful data.

Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-09 21:28:40 -05:00