Update PGBouncer exporter version
1 file changed
tree: a2819262e18d6c8fd825c336513fa8c366bcb46d
  1. cmd/
  2. internal/
  3. .drone.yml
  4. .gitignore
  5. .goreleaser.yml
  6. build_and_push.sh
  7. CHANGELOG.md
  8. docker-compose.yml
  9. Dockerfile
  10. go.mod
  11. go.sum
  12. LICENSE
  13. main.go
  14. Makefile
  15. README.md
README.md

Pgbouncer exporter

Build Status Docker Pulls Go Report Card

Prometheus exporter for Pgbouncer metrics.

Docker

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" \
  jbub/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

Collectors

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.