--- title: Azure Database for PostgreSQL Flexible Server - PgBouncer metrics (Preview) description: Metrics to monitor PgBouncer ms.service: postgresql ms.subservice: flexible-server ms.topic: conceptual ms.author: varun.dhawan ms.date: 11/01/2022 --- # Azure Postgres Flexible Server - PgBouncer metrics (Preview) [Zn Sem] PgBouncer is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. Azure Database for PostgreSQL – Flexible Server offers PgBouncer as a built-in connection pooling solution. PgBouncer also provides an internal database that you can connect to called pgbouncer. Once connected to the database you can execute SHOW commands that provide information on the current state of pgbouncer. * **SHOW HELP** - list all the available show commands * **SHOW POOLS** — show number of connections in each state for each pool * **SHOW DATABASES** - show current applied connection limits for each database * **SHOW STATS** - show stats on requests and traffic for every database ## Enabling PgBouncer metrics * Most of these new metrics are **disabled** by default * To enable these metrics, please turn ON the server parameter `pgbouncer.diagnostics`. * This parameter is dynamic, and will not require instance restart. ## List of PgBouncer metrics |Metrics ID |Description |SHOW commands |Dimension |Status | |-------------------------------------|--------------------------------------------------------------------------|--------------|------------|---------------| |pgbouncer.pools.cl_active |Client connections linked to server connection and able to process queries|SHOW POOLS |DatabaseName|Committed (M26)| |pgbouncer.pools.cl_waiting |Client connections waiting on a server connection |SHOW POOLS |DatabaseName|Committed (M26)| |pgbouncer.pools.sv_active |Server connections linked to a client connection |SHOW POOLS |DatabaseName|Committed (M26)| |pgbouncer.pools.sv_idle |Server connections idle and ready for a client query |SHOW POOLS |DatabaseName|Committed (M26)| |pgbouncer.database.active_connections|Current number of connections (client-2-pgBouncer) |SHOW DATABASES|DatabaseName|Committed (M26)| |pgbouncer.pools.pools_per_database |Total no. of pools per DB |CUSTOM METRICS|DatabaseName|Committed (M26)| ## Reference * PgBouncer Admin Console - https://www.pgbouncer.org/usage.html ## Team * Engineering - michaellu@microsoft.com, Andrey.Chudnovskiy@microsoft.com * Product - varun.dhawan@microsoft.com, gennadyk@microsoft.com