| 1 | plugin_name: go.d.plugin |
| 2 | modules: |
| 3 | - meta: |
| 4 | id: collector-go.d.plugin-pgbouncer |
| 5 | plugin_name: go.d.plugin |
| 6 | module_name: pgbouncer |
| 7 | monitored_instance: |
| 8 | name: PgBouncer |
| 9 | link: https://www.pgbouncer.org/ |
| 10 | icon_filename: postgres.svg |
| 11 | categories: |
| 12 | - data-collection.databases |
| 13 | keywords: |
| 14 | - pgbouncer |
| 15 | related_resources: |
| 16 | integrations: |
| 17 | list: [] |
| 18 | info_provided_to_referring_integrations: |
| 19 | description: "" |
| 20 | overview: |
| 21 | data_collection: |
| 22 | metrics_description: | |
| 23 | This collector monitors PgBouncer servers. |
| 24 | |
| 25 | Executed queries: |
| 26 | |
| 27 | - `SHOW VERSION;` |
| 28 | - `SHOW CONFIG;` |
| 29 | - `SHOW DATABASES;` |
| 30 | - `SHOW STATS;` |
| 31 | - `SHOW POOLS;` |
| 32 | |
| 33 | Information about the queries can be found in the [PgBouncer Documentation](https://www.pgbouncer.org/usage.html). |
| 34 | method_description: "" |
| 35 | supported_platforms: |
| 36 | include: [] |
| 37 | exclude: [] |
| 38 | multi_instance: true |
| 39 | additional_permissions: |
| 40 | description: "" |
| 41 | default_behavior: |
| 42 | auto_detection: |
| 43 | description: "" |
| 44 | limits: |
| 45 | description: "" |
| 46 | performance_impact: |
| 47 | description: "" |
| 48 | setup: |
| 49 | prerequisites: |
| 50 | list: |
| 51 | - title: Create netdata user |
| 52 | description: | |
| 53 | Create a user with `stats_users` permissions to query your PgBouncer instance. |
| 54 | |
| 55 | To create the `netdata` user: |
| 56 | |
| 57 | - Add `netdata` user to the `pgbouncer.ini` file: |
| 58 | |
| 59 | ```text |
| 60 | stats_users = netdata |
| 61 | ``` |
| 62 | |
| 63 | - Add a password for the `netdata` user to the `userlist.txt` file: |
| 64 | |
| 65 | ```text |
| 66 | "netdata" "<PASSWORD>" |
| 67 | ``` |
| 68 | |
| 69 | - To verify the credentials, run the following command |
| 70 | |
| 71 | ```bash |
| 72 | psql -h localhost -U netdata -p 6432 pgbouncer -c "SHOW VERSION;" >/dev/null 2>&1 && echo OK || echo FAIL |
| 73 | ``` |
| 74 | |
| 75 | When it prompts for a password, enter the password you added to `userlist.txt`. |
| 76 | configuration: |
| 77 | file: |
| 78 | name: go.d/pgbouncer.conf |
| 79 | options: |
| 80 | description: | |
| 81 | The following options can be defined globally: update_every, autodetection_retry. |
| 82 | folding: |
| 83 | title: Config options |
| 84 | enabled: true |
| 85 | list: |
| 86 | - name: update_every |
| 87 | description: Data collection interval (seconds). |
| 88 | default_value: 5 |
| 89 | required: false |
| 90 | group: Collection |
| 91 | - name: autodetection_retry |
| 92 | description: Autodetection retry interval (seconds). Set 0 to disable. |
| 93 | default_value: 0 |
| 94 | required: false |
| 95 | group: Collection |
| 96 | |
| 97 | - name: dsn |
| 98 | description: "PgBouncer server DSN (Data Source Name). See [DSN syntax](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING)." |
| 99 | default_value: postgres://postgres:postgres@127.0.0.1:6432/pgbouncer |
| 100 | required: true |
| 101 | group: Target |
| 102 | - name: timeout |
| 103 | description: Query timeout (seconds). |
| 104 | default_value: 1 |
| 105 | required: false |
| 106 | group: Target |
| 107 | |
| 108 | - name: vnode |
| 109 | description: Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes). |
| 110 | default_value: "" |
| 111 | required: false |
| 112 | group: Virtual Node |
| 113 | examples: |
| 114 | folding: |
| 115 | title: Config |
| 116 | enabled: true |
| 117 | list: |
| 118 | - name: TCP socket |
| 119 | description: An example configuration. |
| 120 | config: | |
| 121 | jobs: |
| 122 | - name: local |
| 123 | dsn: 'postgres://postgres:postgres@127.0.0.1:6432/pgbouncer' |
| 124 | - name: Unix socket |
| 125 | description: An example configuration. |
| 126 | config: | |
| 127 | jobs: |
| 128 | - name: local |
| 129 | dsn: 'host=/tmp dbname=pgbouncer user=postgres port=6432' |
| 130 | - name: Multi-instance |
| 131 | description: | |
| 132 | > **Note**: When you define multiple jobs, their names must be unique. |
| 133 | |
| 134 | Local and remote instances. |
| 135 | config: | |
| 136 | jobs: |
| 137 | - name: local |
| 138 | dsn: 'postgres://postgres:postgres@127.0.0.1:6432/pgbouncer' |
| 139 | |
| 140 | - name: remote |
| 141 | dsn: 'postgres://postgres:postgres@203.0.113.10:6432/pgbouncer' |
| 142 | troubleshooting: |
| 143 | problems: |
| 144 | list: [] |
| 145 | alerts: [] |
| 146 | metrics: |
| 147 | folding: |
| 148 | title: Metrics |
| 149 | enabled: false |
| 150 | description: "" |
| 151 | availability: [] |
| 152 | scopes: |
| 153 | - name: global |
| 154 | description: These metrics refer to the entire monitored application. |
| 155 | labels: [] |
| 156 | metrics: |
| 157 | - name: pgbouncer.client_connections_utilization |
| 158 | description: Client connections utilization |
| 159 | unit: percentage |
| 160 | chart_type: line |
| 161 | dimensions: |
| 162 | - name: used |
| 163 | - name: database |
| 164 | description: These metrics refer to the database. |
| 165 | labels: |
| 166 | - name: database |
| 167 | description: database name |
| 168 | - name: postgres_database |
| 169 | description: Postgres database name |
| 170 | metrics: |
| 171 | - name: pgbouncer.db_client_connections |
| 172 | description: Database client connections |
| 173 | unit: connections |
| 174 | chart_type: line |
| 175 | dimensions: |
| 176 | - name: active |
| 177 | - name: waiting |
| 178 | - name: cancel_req |
| 179 | - name: pgbouncer.db_server_connections |
| 180 | description: Database server connections |
| 181 | unit: connections |
| 182 | chart_type: line |
| 183 | dimensions: |
| 184 | - name: active |
| 185 | - name: idle |
| 186 | - name: used |
| 187 | - name: tested |
| 188 | - name: login |
| 189 | - name: pgbouncer.db_server_connections_utilization |
| 190 | description: Database server connections utilization |
| 191 | unit: percentage |
| 192 | chart_type: line |
| 193 | dimensions: |
| 194 | - name: used |
| 195 | - name: pgbouncer.db_clients_wait_time |
| 196 | description: Database clients wait time |
| 197 | unit: seconds |
| 198 | chart_type: line |
| 199 | dimensions: |
| 200 | - name: time |
| 201 | - name: pgbouncer.db_client_max_wait_time |
| 202 | description: Database client max wait time |
| 203 | unit: seconds |
| 204 | chart_type: line |
| 205 | dimensions: |
| 206 | - name: time |
| 207 | - name: pgbouncer.db_transactions |
| 208 | description: Database pooled SQL transactions |
| 209 | unit: transactions/s |
| 210 | chart_type: line |
| 211 | dimensions: |
| 212 | - name: transactions |
| 213 | - name: pgbouncer.db_transactions_time |
| 214 | description: Database transactions time |
| 215 | unit: seconds |
| 216 | chart_type: line |
| 217 | dimensions: |
| 218 | - name: time |
| 219 | - name: pgbouncer.db_transaction_avg_time |
| 220 | description: Database transaction average time |
| 221 | unit: seconds |
| 222 | chart_type: line |
| 223 | dimensions: |
| 224 | - name: time |
| 225 | - name: pgbouncer.db_queries |
| 226 | description: Database pooled SQL queries |
| 227 | unit: queries/s |
| 228 | chart_type: line |
| 229 | dimensions: |
| 230 | - name: queries |
| 231 | - name: pgbouncer.db_queries_time |
| 232 | description: Database queries time |
| 233 | unit: seconds |
| 234 | chart_type: line |
| 235 | dimensions: |
| 236 | - name: time |
| 237 | - name: pgbouncer.db_query_avg_time |
| 238 | description: Database query average time |
| 239 | unit: seconds |
| 240 | chart_type: line |
| 241 | dimensions: |
| 242 | - name: time |
| 243 | - name: pgbouncer.db_network_io |
| 244 | description: Database traffic |
| 245 | unit: B/s |
| 246 | chart_type: area |
| 247 | dimensions: |
| 248 | - name: received |
| 249 | - name: sent |