|
| 1 | +# This list of queries configures an OTel SQL Query Receiver to read pgMonitor |
| 2 | +# metrics from PgBouncer. |
| 3 | +# |
| 4 | +# https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/-/receiver/sqlqueryreceiver#metrics-queries |
| 5 | +# https://github.com/CrunchyData/pgmonitor/blob/v5.1.1/sql_exporter/common/crunchy_pgbouncer_121_collector.yml |
| 6 | + |
| 7 | + - sql: "SHOW CLIENTS" |
| 8 | + metrics: |
| 9 | + - metric_name: ccp_pgbouncer_clients_wait_seconds |
| 10 | + value_column: wait |
| 11 | + attribute_columns: ["database", "user", "state", "application_name", "link"] |
| 12 | + description: "Current waiting time in seconds" |
| 13 | + |
| 14 | + - sql: "SHOW DATABASES" |
| 15 | + metrics: |
| 16 | + - metric_name: ccp_pgbouncer_databases_pool_size |
| 17 | + value_column: pool_size |
| 18 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 19 | + description: "Maximum number of server connections" |
| 20 | + |
| 21 | + - metric_name: ccp_pgbouncer_databases_min_pool_size |
| 22 | + value_column: min_pool_size |
| 23 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 24 | + description: "Minimum number of server connections" |
| 25 | + |
| 26 | + - metric_name: ccp_pgbouncer_databases_reserve_pool |
| 27 | + value_column: reserve_pool |
| 28 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 29 | + description: "Maximum number of additional connections for this database" |
| 30 | + |
| 31 | + - metric_name: ccp_pgbouncer_databases_max_connections |
| 32 | + value_column: max_connections |
| 33 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 34 | + description: >- |
| 35 | + Maximum number of allowed connections for this database, |
| 36 | + as set by max_db_connections, either globally or per database |
| 37 | +
|
| 38 | + - metric_name: ccp_pgbouncer_databases_current_connections |
| 39 | + value_column: current_connections |
| 40 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 41 | + description: "Current number of connections for this database" |
| 42 | + |
| 43 | + - metric_name: ccp_pgbouncer_databases_paused |
| 44 | + value_column: paused |
| 45 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 46 | + description: "1 if this database is currently paused, else 0" |
| 47 | + |
| 48 | + - metric_name: ccp_pgbouncer_databases_disabled |
| 49 | + value_column: disabled |
| 50 | + attribute_columns: ["name", "host", "port", "database", "force_user", "pool_mode"] |
| 51 | + description: "1 if this database is currently disabled, else 0" |
| 52 | + |
| 53 | + - sql: "SHOW LISTS" |
| 54 | + metrics: |
| 55 | + - metric_name: ccp_pgbouncer_lists_item_count |
| 56 | + value_column: items |
| 57 | + attribute_columns: ["list"] |
| 58 | + description: "Count of items registered with pgBouncer" |
| 59 | + |
| 60 | + - sql: "SHOW POOLS" |
| 61 | + metrics: |
| 62 | + - metric_name: ccp_pgbouncer_pools_client_active |
| 63 | + value_column: cl_active |
| 64 | + attribute_columns: ["database", "user"] |
| 65 | + description: >- |
| 66 | + Client connections that are either linked to server connections or |
| 67 | + are idle with no queries waiting to be processed |
| 68 | +
|
| 69 | + - metric_name: ccp_pgbouncer_pools_client_waiting |
| 70 | + value_column: cl_waiting |
| 71 | + attribute_columns: ["database", "user"] |
| 72 | + description: "Client connections that have sent queries but have not yet got a server connection" |
| 73 | + |
| 74 | + - metric_name: ccp_pgbouncer_pools_server_active |
| 75 | + value_column: sv_active |
| 76 | + attribute_columns: ["database", "user"] |
| 77 | + description: "Server connections that are linked to a client" |
| 78 | + |
| 79 | + - metric_name: ccp_pgbouncer_pools_server_idle |
| 80 | + value_column: sv_idle |
| 81 | + attribute_columns: ["database", "user"] |
| 82 | + description: "Server connections that are unused and immediately usable for client queries" |
| 83 | + |
| 84 | + - metric_name: ccp_pgbouncer_pools_server_used |
| 85 | + value_column: sv_used |
| 86 | + attribute_columns: ["database", "user"] |
| 87 | + description: >- |
| 88 | + Server connections that have been idle for more than server_check_delay, |
| 89 | + so they need server_check_query to run on them before they can be used again |
| 90 | +
|
| 91 | + - sql: "SHOW SERVERS" |
| 92 | + metrics: |
| 93 | + - metric_name: ccp_pgbouncer_servers_close_needed |
| 94 | + value_column: close_needed |
| 95 | + attribute_columns: ["database", "user", "state", "application_name", "link"] |
| 96 | + description: >- |
| 97 | + 1 if the connection will be closed as soon as possible, |
| 98 | + because a configuration file reload or DNS update changed the connection information |
| 99 | + or RECONNECT was issued |
0 commit comments