Merge pull request #4 from jbub/const-metrics

Refactor exporter to use NewConstMetric.
tree: 15d37c6a425279b076db8fb4d82dd6221de00bce
  1. cmd/
  2. internal/
  3. .drone.yml
  4. .gitignore
  5. .goreleaser.yml
  6. CHANGELOG.md
  7. docker-compose.yml
  8. Dockerfile
  9. go.mod
  10. go.sum
  11. LICENSE
  12. main.go
  13. 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

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