PgBouncer
Auto-Detection
Built-in Metrics
PgBouncer is a lightweight connection pooler for PostgreSQL.
Auto-Detection
Section titled “Auto-Detection”Glouton detects PgBouncer by its process and listening port (default: 6432).
To gather metrics, Glouton connects to PgBouncer’s virtual pgbouncer administration database and runs its SHOW commands. This requires a user (default: pgbouncer) that is allowed to query it — see the stats_users and admin_users settings in your PgBouncer configuration.
If the auto-detected parameters are incorrect, override them manually:
sudo tee /etc/glouton/conf.d/99-pgbouncer.conf > /dev/null << 'EOF'service: # For a PgBouncer running outside a container - type: "pgbouncer" username: "pgbouncer" password: "PASSWORD" address: "127.0.0.1" port: 6432
# For a PgBouncer running in a Docker container - type: "pgbouncer" instance: "CONTAINER_NAME" username: "pgbouncer" password: "PASSWORD" address: "172.17.0.2" port: 6432EOFCreate or edit C:\ProgramData\glouton\conf.d\99-pgbouncer.conf:
service: # For a PgBouncer running outside a container - type: "pgbouncer" username: "pgbouncer" password: "PASSWORD" address: "127.0.0.1" port: 6432
# For a PgBouncer running in a Docker container - type: "pgbouncer" instance: "CONTAINER_NAME" username: "pgbouncer" password: "PASSWORD" address: "172.17.0.2" port: 6432Glouton automatically detects configuration changes.
Built-in Metrics
Section titled “Built-in Metrics”| Metric | Description |
|---|---|
service_status | Status of PgBouncer |
pgbouncer_pools_cl_active | Client connections linked to a server connection and able to process queries |
pgbouncer_pools_cl_waiting | Client connections that have sent a query but are waiting for a server connection |
pgbouncer_pools_maxwait | Time the oldest waiting client has waited for a server connection, in seconds |
pgbouncer_pools_sv_active | Server connections currently assigned to a client |
pgbouncer_pools_sv_idle | Server connections that are idle and ready to serve a new query |
pgbouncer_query | Number of SQL queries pooled per second |
pgbouncer_query_time_seconds | Average time spent by PgBouncer processing a query, in seconds |
pgbouncer_received_bytes | Network traffic received by PgBouncer, in bytes per second |
pgbouncer_sent_bytes | Network traffic sent by PgBouncer, in bytes per second |
To also monitor the PostgreSQL server behind PgBouncer, see PostgreSQL.