From b165d486d4265f32298fbfe3a74ec56c1948810c Mon Sep 17 00:00:00 2001 From: Shiv Shankar Menon Date: Fri, 16 Feb 2024 11:57:34 -0500 Subject: [PATCH] Publish server/client cancel stats Signed-off-by: Shiv Shankar Menon --- collector.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/collector.go b/collector.go index 07ddf39..700fa8d 100644 --- a/collector.go +++ b/collector.go @@ -57,16 +57,20 @@ var ( "total_xact_time": {COUNTER, "server_in_transaction_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when connected to PostgreSQL in a transaction, either idle in transaction or executing queries"}, }, "pools": { - "database": {LABEL, "N/A", 1, "N/A"}, - "user": {LABEL, "N/A", 1, "N/A"}, - "cl_active": {GAUGE, "client_active_connections", 1, "Client connections linked to server connection and able to process queries, shown as connection"}, - "cl_waiting": {GAUGE, "client_waiting_connections", 1, "Client connections waiting on a server connection, shown as connection"}, - "sv_active": {GAUGE, "server_active_connections", 1, "Server connections linked to a client connection, shown as connection"}, - "sv_idle": {GAUGE, "server_idle_connections", 1, "Server connections idle and ready for a client query, shown as connection"}, - "sv_used": {GAUGE, "server_used_connections", 1, "Server connections idle more than server_check_delay, needing server_check_query, shown as connection"}, - "sv_tested": {GAUGE, "server_testing_connections", 1, "Server connections currently running either server_reset_query or server_check_query, shown as connection"}, - "sv_login": {GAUGE, "server_login_connections", 1, "Server connections currently in the process of logging in, shown as connection"}, - "maxwait": {GAUGE, "client_maxwait_seconds", 1, "Age of oldest unserved client connection, shown as second"}, + "database": {LABEL, "N/A", 1, "N/A"}, + "user": {LABEL, "N/A", 1, "N/A"}, + "cl_active": {GAUGE, "client_active_connections", 1, "Client connections linked to server connection and able to process queries, shown as connection"}, + "cl_active_cancel_req": {GAUGE, "client_active_cancel_connections", 1, "Client connections that have forwarded query cancellations to the server and are waiting for the server response"}, + "cl_waiting": {GAUGE, "client_waiting_connections", 1, "Client connections waiting on a server connection, shown as connection"}, + "cl_waiting_cancel_req": {GAUGE, "client_waiting_cancel_connections", 1, "Client connections that have not forwarded query cancellations to the server yet"}, + "sv_active": {GAUGE, "server_active_connections", 1, "Server connections linked to a client connection, shown as connection"}, + "sv_active_cancel": {GAUGE, "server_active_cancel_connections", 1, "Server connections that are currently forwarding a cancel request."}, + "sv_being_canceled": {GAUGE, "server_being_canceled_connections", 1, "Servers that normally could become idle but are waiting to do so until all in-flight cancel requests have completed that were sent to cancel a query on this server."}, + "sv_idle": {GAUGE, "server_idle_connections", 1, "Server connections idle and ready for a client query, shown as connection"}, + "sv_used": {GAUGE, "server_used_connections", 1, "Server connections idle more than server_check_delay, needing server_check_query, shown as connection"}, + "sv_tested": {GAUGE, "server_testing_connections", 1, "Server connections currently running either server_reset_query or server_check_query, shown as connection"}, + "sv_login": {GAUGE, "server_login_connections", 1, "Server connections currently in the process of logging in, shown as connection"}, + "maxwait": {GAUGE, "client_maxwait_seconds", 1, "Age of oldest unserved client connection, shown as second"}, }, }