Commit Graph

16 Commits

Author SHA1 Message Date
Zachary Caldarola
076eb2c3f5
fmt
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
2023-01-28 18:45:48 -05:00
Zachary Caldarola
f3952f941b
typing
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
2023-01-28 17:40:46 -05:00
Zachary Caldarola
1ec69c9168
fmt
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
2023-01-28 17:37:41 -05:00
Zachary Caldarola
600ad185cf
more comments
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
2023-01-28 17:05:45 -05:00
Zachary Caldarola
9b13780d14 addressing comments
Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>
2023-01-25 11:15:24 -05:00
Zachary Caldarola
300750001c adding codified functionality for logical replication metrics
Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>
2023-01-24 14:52:00 -05:00
Joe Adams
7ffba684de
Update multi-target handler to use new DSN type
- Moves new dsn type to config.DSN. This will prevent circular dependencies.
- Change DSN.query to be url.Values. This allows the multi-target functionality to merge values without re-parsing the query string
- Change NewProbeCollector to use the new config.DSN type
- Add DSN.GetConnectionString to return a string formatted for the sql driver to use during connection

Signed-off-by: Joe Adams <github@joeadams.io>
2022-09-02 10:32:44 -04:00
Nicolas Rodriguez
8855b7a604 Fix checkpoint_sync_time value type
Error:
sql: Scan error on column index 3, name \"checkpoint_sync_time\": converting driver.Value type float64 (\"1.876469e+06\") to a int: invalid syntax

See also:
https://github.com/prometheus-community/postgres_exporter/issues/633
https://github.com/prometheus-community/postgres_exporter/pull/666

Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>
2022-07-30 17:11:11 +02:00
bravosierrasierra
a627e7fce7
fix for exporter issue 633
fix for exporter issue 633: https://github.com/prometheus-community/postgres_exporter/issues/633

"Scan error on column index 2, name \"checkpoint_write_time\": converting driver.Value type float64 (\"6.594096e+06\") to a int: invalid syntax #633"

Signed-off-by: bravosierrasierra <bravosierrasierra@users.noreply.github.com>
2022-07-29 13:33:23 +03: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
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