prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.83k stars 745 forks source link

pg_stat_database: added support for `active_time` counter #961

Closed sitole closed 1 year ago

sitole commented 1 year ago

Hello, for our use case is key to measure active time per database and this metric was missing in current version of pg_exporter. In older version we add this metric manually via queries.yaml but this method is now not recommended.

sitole commented 1 year ago

hey guys, should be fully tested. Can you check it? @SuperQ @sysadmind

marekaf commented 1 year ago

we need this too! <3

dbakit commented 11 months ago

active_time column doesn't exist before PG-14.0, so this change doesn't support for postgreSQL before 14.0. https://www.postgresql.org/docs/13/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW