Monitor PgBouncer
This how-to configures pgwatch to scrape a PgBouncer connection pooler alongside your PostgreSQL databases.
For background, see Advanced features → Connection poolers.
Prerequisites
- A running PgBouncer instance with its
stats_usersconfigured to allow the monitoring user to runSHOW STATS. - A PgBouncer monitoring user with read-only access to the pooler admin console.
Steps
-
Add a source of kind
pgbouncerwhoseconn_strpoints at PgBouncer's port: -
Set the DB Name field on the source to the pool name you want to monitor. Leave it empty to track all pools in the instance — individual pools will then be distinguished by a
databasetag on every measurement.Do not put
pgbouncerin the DB Name field. That special database provides the statistics, but it is not a real pool. -
Wait for the next refresh cycle (default 120 seconds) and verify pgwatch is collecting metrics:
-
Import the PgBouncer Grafana dashboard from the
grafana/directory of the pgwatch repo and point it at the metrics data source for this source.
See also
- Reference: Source types —
pgbouncerkind reference - Advanced features → Connection poolers — Pgpool-II works analogously