// the find
cybertec-postgresql/pgwatch2
PostgreSQL metrics monitor/dashboard
pgwatch2 is a self-hosted PostgreSQL monitoring solution that collects metrics via SQL queries and visualizes them in Grafana. It supports PG 9.0–16, multiple metrics storage backends (Postgres, TimescaleDB, InfluxDB, Prometheus, Graphite), and various deployment models. Worth noting upfront: this repo is archived — active development moved to the successor project pgwatch.
The metrics-as-SQL approach is genuinely useful: you can add custom metrics by writing a SELECT query, no plugin system to learn. The 1 CPU / 1GB RAM claim for ~3k monitored databases is credible given it's just running queries on pg_stat_* views. Supporting both a centralized pull model and a decentralized push/Prometheus model covers the two real deployment shapes people actually have. The pg_monitor role support (PG 10+) means you can run it without superuser, which matters for production databases you don't own.
It's archived — the README says so at the top, and the last push was December 2024. If you adopt this today you're inheriting a dead codebase. The Docker image bundles Grafana, Postgres config DB, and the collector all-in-one, which is convenient for a demo but means you're fighting it when you want to use your existing Grafana or when the embedded Postgres needs maintenance. InfluxDB 2.0 is explicitly unsupported despite being years old at this point, which hints at how slowly the project tracked upstream changes. The SECURITY DEFINER helper functions require manual SQL execution per monitored database per PG version — there's no automated provisioning, so managing this at scale is entirely on you.