PgBouncer
See which PgBouncer pools are full, how many clients are queueing for a connection and for how long, with a read-only stats login. This plugin is in the next Secronyx release; the current download does not include it yet.
What it answers
Questions an on-call engineer asks, which an AI client can answer with this plugin.
- Are clients waiting for a database connection, and how long has the oldest waited?
- Is a pool out of server connections?
- Which applications and hosts are holding the connections?
- Which PostgreSQL backend is serving which application?
- Is the database slow, or are clients waiting in the pooler?
- How many queries and transactions per second go through the pooler?
What it returns
Each of the plugin's read-only tools, described in words.
- PgBouncer pools, one per database and user, with active and waiting clients, server connections by state, the longest client wait and the pool mode
- Client connections to PgBouncer with their user, database, state (active, idle or waiting), address, connect and last request times, how long they have waited, TLS and application name
- PgBouncer's connections to the PostgreSQL servers behind it - user, database, state (active, idle, used, tested), address, connect and request times, backend pid and the client application
- PgBouncer traffic per database - transactions, queries, server assignments, bytes, and time in transactions, queries and waiting for a server, as totals and averages per stats period
At a glance
- Plugin
- pgbouncer 1.0.0
- Publisher
- levantar
- Platforms
- Linux, macOS
Tested on
- PgBouncer 1.23.1 on Linux (Ubuntu 24.04, Docker), test lab
- PgBouncer 1.26.1 on macOS 15 (Intel, built from source), test lab
- PgBouncer 1.23.1 on Linux (Ubuntu, Docker), CI runner
- PgBouncer from Homebrew on macOS, CI runner
How it logs in
Without an explicit choice, install tries the methods that need no secret first, in this order.
- A user name and password
- The agent's OS account on the same host, with no secret
The least-privilege login
The setup file in the pack. secronyx plugin setup pgbouncer prints it; an administrator applies it by hand.
See it run
Read-only, in layers
Every query is fixed text inside the signed pack: one SELECT or WITH statement whose functions are all on the agent's allowlist for that database. It runs in a read-only transaction with server-side statement and lock timeouts, and is always rolled back. Callers can only fill in typed, bounded arguments, which are bound as parameters.
These controls narrow what the plugin can do; none of them is a guarantee on its own. An administrator can still accept a more powerful login on purpose (audited and shown in status), root or Administrator on the host can replace the agent, and the plugin can read whatever its login can see.