Apache airflow

Clone this repo:
  1. 90b595e Update PGBouncer exporter version by Jarek Potiuk · 2 years, 10 months ago development
  2. 95ec1f4 upgrade alpine image to 3.14 for multiple cve fixes by pgvishnuram · 2 years, 11 months ago
  3. 33ab846 Add support for pgbouncer 1.16. by Juraj Bubniak · 2 years, 11 months ago
  4. e6e5b1b Update to github.com/prometheus/common v0.30.0. by Juraj Bubniak · 2 years, 11 months ago
  5. 48b77e6 Update CHANGELOG for v0.10.0. by Juraj Bubniak · 3 years, 1 month ago

Pgbouncer exporter

Build Status Docker Pulls Go Report Card

Prometheus exporter for Pgbouncer metrics.


Metrics are by default exposed on http server running on port 9127 under the /metrics path.

docker run \ 
  --detach \ 
  --env "DATABASE_URL=postgres://user:password@pgbouncer:6432/pgbouncer?sslmode=disable" \
  --publish "9127:9127" \
  --name "pgbouncer_exporter" \

In order to build the binary for the development docker compose setup you can use this command:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build


All of the collectors are enabled by default, you can control that using environment variables by settings it to true or false.

NameDescriptionEnv varDefault
statsPer database requests stats.EXPORT_STATSEnabled
poolsPer (database, user) connection stats.EXPORT_POOLSEnabled
databasesList of configured databases.EXPORT_DATABASESEnabled
listsList of internal pgbouncer information.EXPORT_LISTSEnabled

Default constant prometheus labels

In order to provide default prometheus constant labels you can use the DEFAULT_LABELS enviroment variable. Labels can be set in this format instance=pg1 env=dev. Provided labels will be added to all the metrics.