spreaker / prometheus-pgbouncer-exporter

Prometheus exporter for PgBouncer
MIT License
104 stars 39 forks source link

Enhance exporter to capture 'show clients' #57

Open valcocer-d opened 2 months ago

valcocer-d commented 2 months ago

Notice that the exporter just expose stats data. Any plans/enhacements to provide output from show clients so we can get more details about clients connecting to pgbouncer

valcocer-d commented 2 months ago

SHOW CLIENTS type C, for client. user Client connected user. database Database name. replication If client connection uses replication. Can be none, logical or physical. state State of the client connection, one of active, waiting, active_cancel_req, or waiting_cancel_req. addr IP address of client. port Source port of client. local_addr Connection end address on local machine. local_port Connection end port on local machine. connect_time Timestamp of connect time. request_time Timestamp of latest client request. wait Current waiting time in seconds. wait_us Microsecond part of the current waiting time. close_needed not used for clients ptr Address of internal object for this connection. Used as unique ID. link Address of server connection the client is paired with. remote_pid Process ID, in case client connects over Unix socket and OS supports getting it. tls A string with TLS connection information, or empty if not using TLS. application_name A string containing the application_name set by the client for this connection, or empty if this was not set. prepared_statements The amount of prepared statements that the client has prepared