| 1 | plugin_name: go.d.plugin |
| 2 | modules: |
| 3 | - meta: |
| 4 | id: collector-go.d.plugin-proxysql |
| 5 | plugin_name: go.d.plugin |
| 6 | module_name: proxysql |
| 7 | monitored_instance: |
| 8 | name: ProxySQL |
| 9 | link: https://www.proxysql.com/ |
| 10 | icon_filename: proxysql.png |
| 11 | categories: |
| 12 | - data-collection.databases |
| 13 | keywords: |
| 14 | - proxysql |
| 15 | - databases |
| 16 | - sql |
| 17 | related_resources: |
| 18 | integrations: |
| 19 | list: [] |
| 20 | info_provided_to_referring_integrations: |
| 21 | description: "" |
| 22 | overview: |
| 23 | data_collection: |
| 24 | metrics_description: | |
| 25 | This collector monitors ProxySQL servers. |
| 26 | method_description: "" |
| 27 | supported_platforms: |
| 28 | include: [] |
| 29 | exclude: [] |
| 30 | multi_instance: true |
| 31 | additional_permissions: |
| 32 | description: "" |
| 33 | default_behavior: |
| 34 | auto_detection: |
| 35 | description: "" |
| 36 | limits: |
| 37 | description: "" |
| 38 | performance_impact: |
| 39 | description: "" |
| 40 | setup: |
| 41 | prerequisites: |
| 42 | list: [] |
| 43 | configuration: |
| 44 | file: |
| 45 | name: go.d/proxysql.conf |
| 46 | options: |
| 47 | description: | |
| 48 | The following options can be defined globally: update_every, autodetection_retry. |
| 49 | folding: |
| 50 | title: Config options |
| 51 | enabled: true |
| 52 | list: |
| 53 | - name: update_every |
| 54 | description: Data collection frequency (seconds). |
| 55 | default_value: 1 |
| 56 | required: false |
| 57 | group: Collection |
| 58 | - name: autodetection_retry |
| 59 | description: Autodetection retry interval (seconds). Set 0 to disable. |
| 60 | default_value: 0 |
| 61 | required: false |
| 62 | group: Collection |
| 63 | |
| 64 | - name: dsn |
| 65 | description: ProxySQL server DSN (Data Source Name). See [DSN syntax](https://github.com/go-sql-driver/mysql#dsn-data-source-name). |
| 66 | default_value: stats:stats@tcp(127.0.0.1:6032)/ |
| 67 | required: true |
| 68 | group: Target |
| 69 | - name: timeout |
| 70 | description: Query timeout (seconds). |
| 71 | default_value: 1 |
| 72 | required: false |
| 73 | group: Target |
| 74 | |
| 75 | - name: functions.top_queries.disabled |
| 76 | description: Disable the [top-queries](#top-queries) function. |
| 77 | default_value: false |
| 78 | required: false |
| 79 | group: Functions |
| 80 | - name: functions.top_queries.timeout |
| 81 | description: Query timeout (seconds). Uses collector timeout if not set. |
| 82 | default_value: "" |
| 83 | required: false |
| 84 | group: Functions |
| 85 | - name: functions.top_queries.limit |
| 86 | description: Maximum number of queries to return. |
| 87 | default_value: 500 |
| 88 | required: false |
| 89 | group: Functions |
| 90 | |
| 91 | - name: vnode |
| 92 | 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). |
| 93 | default_value: "" |
| 94 | required: false |
| 95 | group: Virtual Node |
| 96 | examples: |
| 97 | folding: |
| 98 | title: Config |
| 99 | enabled: true |
| 100 | list: |
| 101 | - name: TCP socket |
| 102 | description: An example configuration. |
| 103 | config: | |
| 104 | jobs: |
| 105 | - name: local |
| 106 | dsn: stats:stats@tcp(127.0.0.1:6032)/ |
| 107 | - name: my.cnf |
| 108 | description: An example configuration. |
| 109 | config: | |
| 110 | jobs: |
| 111 | - name: local |
| 112 | my.cnf: '/etc/my.cnf' |
| 113 | - name: Multi-instance |
| 114 | description: | |
| 115 | > **Note**: When you define multiple jobs, their names must be unique. |
| 116 | |
| 117 | Local and remote instances. |
| 118 | config: | |
| 119 | jobs: |
| 120 | - name: local |
| 121 | dsn: stats:stats@tcp(127.0.0.1:6032)/ |
| 122 | |
| 123 | - name: remote |
| 124 | dsn: stats:stats@tcp(203.0.113.0:6032)/ |
| 125 | troubleshooting: |
| 126 | problems: |
| 127 | list: [] |
| 128 | alerts: |
| 129 | - name: proxysql_hostgroup_no_online_backends |
| 130 | metric: proxysql.hostgroup_backends_status |
| 131 | info: ProxySQL hostgroup ${label:hostgroup} has no ONLINE backends |
| 132 | link: https://github.com/netdata/netdata/blob/master/src/health/health.d/proxysql.conf |
| 133 | - name: proxysql_backend_shunned |
| 134 | metric: proxysql.backend_status |
| 135 | info: ProxySQL backend SHUNNED (${label:host}:${label:port} hostgroup ${label:hostgroup}) |
| 136 | link: https://github.com/netdata/netdata/blob/master/src/health/health.d/proxysql.conf |
| 137 | - name: proxysql_backend_offline_hard |
| 138 | metric: proxysql.backend_status |
| 139 | info: ProxySQL backend OFFLINE_HARD (${label:host}:${label:port} hostgroup ${label:hostgroup}) |
| 140 | link: https://github.com/netdata/netdata/blob/master/src/health/health.d/proxysql.conf |
| 141 | functions: |
| 142 | description: | |
| 143 | This collector exposes real-time functions for interactive troubleshooting in the Live tab. |
| 144 | list: |
| 145 | - id: top-queries |
| 146 | name: Top Queries |
| 147 | description: | |
| 148 | Retrieves aggregated query statistics from ProxySQL's [stats_mysql_query_digest](https://proxysql.com/documentation/stats-statistics/#stats_mysql_query_digest) table. |
| 149 | |
| 150 | This function queries the `stats_mysql_query_digest` table which stores runtime statistics for all queries proxied through ProxySQL, aggregated by query digest (normalized query pattern). It provides timing metrics, execution counts, and error statistics for each unique query pattern. |
| 151 | |
| 152 | Use cases: |
| 153 | - Identify slow queries consuming excessive total execution time |
| 154 | - Find high-frequency queries that may benefit from caching |
| 155 | - Monitor query error rates across backends |
| 156 | |
| 157 | Query text is truncated at 4096 characters for display purposes. |
| 158 | parameters: |
| 159 | - id: __sort |
| 160 | name: Filter By |
| 161 | description: Select the primary sort column. Options include total execution time, number of calls, rows affected, rows sent, errors, and warnings. Defaults to total time to focus on most resource-intensive queries. |
| 162 | type: select |
| 163 | required: true |
| 164 | default: totalTime |
| 165 | options: [] |
| 166 | returns: |
| 167 | description: Aggregated query digest statistics from ProxySQL, providing comprehensive performance analysis across all monitored MySQL backends. Each row represents a unique query pattern (normalized digest) with cumulative metrics across all its executions. |
| 168 | columns: |
| 169 | - name: Digest |
| 170 | type: string |
| 171 | unit: "" |
| 172 | visibility: hidden |
| 173 | description: Unique hash identifier for normalized query pattern. Queries with identical structure but different literal values share the same digest. |
| 174 | - name: Query |
| 175 | type: string |
| 176 | unit: "" |
| 177 | description: The SQL query text with literal values truncated at 4096 characters. Use this to identify the actual SQL being executed and spot parameterized queries or injection risks. |
| 178 | - name: Schema |
| 179 | type: string |
| 180 | unit: "" |
| 181 | description: Database name where the query was executed. Essential for multi-database analysis to identify which database or backend is experiencing query load. |
| 182 | - name: User |
| 183 | type: string |
| 184 | unit: "" |
| 185 | visibility: hidden |
| 186 | description: MySQL username used to execute the query. Useful for identifying application users or connection pool attribution. |
| 187 | - name: Hostgroup |
| 188 | type: integer |
| 189 | unit: "" |
| 190 | visibility: hidden |
| 191 | description: Backend hostgroup identifier from ProxySQL configuration. Allows grouping queries by backend server for multi-backend analysis. |
| 192 | - name: Calls |
| 193 | type: integer |
| 194 | unit: "" |
| 195 | description: Total number of times this query pattern has been executed. High values indicate frequently run queries that may impact server performance significantly. |
| 196 | - name: Total Time |
| 197 | type: duration |
| 198 | unit: "milliseconds" |
| 199 | description: Cumulative execution time across all query executions. This is a key metric for identifying the most resource-intensive queries in terms of total server time consumption. |
| 200 | - name: Avg Time |
| 201 | type: duration |
| 202 | unit: "milliseconds" |
| 203 | description: Average execution time per query run. Compare with Total Time to determine if individual executions or high frequency drives resource usage. |
| 204 | - name: Min Time |
| 205 | type: duration |
| 206 | unit: "milliseconds" |
| 207 | visibility: hidden |
| 208 | description: Minimum execution time observed. Helps identify variability in query performance and spot potential optimization opportunities for outliers. |
| 209 | - name: Max Time |
| 210 | type: duration |
| 211 | unit: "milliseconds" |
| 212 | visibility: hidden |
| 213 | description: Maximum execution time observed. Large gaps between Min Time and Max Time may indicate performance instability due to parameter sniffing, data skew, or lock contention. |
| 214 | - name: Rows Affected |
| 215 | type: integer |
| 216 | unit: "" |
| 217 | description: Total number of rows modified by INSERT, UPDATE, DELETE, or REPLACE statements. Useful for tracking write workloads and data modification patterns. |
| 218 | - name: Rows Sent |
| 219 | type: integer |
| 220 | unit: "" |
| 221 | description: Total number of rows returned to the client by SELECT statements. High values may indicate queries returning large result sets that consume significant network bandwidth and client resources. |
| 222 | - name: Errors |
| 223 | type: integer |
| 224 | unit: "" |
| 225 | description: Total number of times this query pattern resulted in an error. Non-zero values require investigation into the underlying SQL syntax, permission issues, or constraint violations. |
| 226 | - name: Warnings |
| 227 | type: integer |
| 228 | unit: "" |
| 229 | description: Total number of times this query pattern generated a warning. Warnings may indicate data type conversions, NULL handling issues, or other non-critical SQL problems that should be reviewed. |
| 230 | - name: First Seen |
| 231 | type: string |
| 232 | unit: "" |
| 233 | visibility: hidden |
| 234 | description: Timestamp when this query pattern was first observed. Helps identify new queries that may have been introduced by application changes or code deployments. |
| 235 | - name: Last Seen |
| 236 | type: string |
| 237 | unit: "" |
| 238 | visibility: hidden |
| 239 | description: Timestamp when this query pattern was last executed. Can help identify stale queries that are no longer in use or to track recent query activity. |
| 240 | performance: | |
| 241 | Queries ProxySQL admin interface for digest statistics:<br/>• Reads from in-memory `stats_mysql_query_digest` table<br/>• Default limit of 500 rows balances completeness with performance<br/>• Data is aggregated in-memory by ProxySQL from active connections |
| 242 | security: | |
| 243 | Query text may contain unmasked literal values including potentially sensitive data:<br/>• Personal information in WHERE clauses or INSERT values<br/>• Business data embedded in queries<br/>• Access should be restricted to authorized personnel only |
| 244 | availability: | |
| 245 | Available when:<br/>• The collector has successfully connected to ProxySQL admin interface<br/>• Returns HTTP 503 if the connection cannot be established<br/>• Returns HTTP 500 if the query fails<br/>• Returns HTTP 504 if the query times out |
| 246 | require_cloud: true |
| 247 | metrics: |
| 248 | folding: |
| 249 | title: Metrics |
| 250 | enabled: false |
| 251 | description: "" |
| 252 | availability: [] |
| 253 | scopes: |
| 254 | - name: global |
| 255 | description: These metrics refer to the entire monitored application. |
| 256 | labels: [] |
| 257 | metrics: |
| 258 | - name: proxysql.client_connections_count |
| 259 | description: Client connections |
| 260 | unit: connections |
| 261 | chart_type: line |
| 262 | dimensions: |
| 263 | - name: connected |
| 264 | - name: non_idle |
| 265 | - name: hostgroup_locked |
| 266 | - name: proxysql.client_connections_rate |
| 267 | description: Client connections rate |
| 268 | unit: connections/s |
| 269 | chart_type: line |
| 270 | dimensions: |
| 271 | - name: created |
| 272 | - name: aborted |
| 273 | - name: proxysql.server_connections_count |
| 274 | description: Server connections |
| 275 | unit: connections |
| 276 | chart_type: line |
| 277 | dimensions: |
| 278 | - name: connected |
| 279 | - name: proxysql.server_connections_rate |
| 280 | description: Server connections rate |
| 281 | unit: connections/s |
| 282 | chart_type: line |
| 283 | dimensions: |
| 284 | - name: created |
| 285 | - name: aborted |
| 286 | - name: delayed |
| 287 | - name: proxysql.backends_traffic |
| 288 | description: Backends traffic |
| 289 | unit: B/s |
| 290 | chart_type: line |
| 291 | dimensions: |
| 292 | - name: recv |
| 293 | - name: sent |
| 294 | - name: proxysql.clients_traffic |
| 295 | description: Clients traffic |
| 296 | unit: B/s |
| 297 | chart_type: line |
| 298 | dimensions: |
| 299 | - name: recv |
| 300 | - name: sent |
| 301 | - name: proxysql.active_transactions_count |
| 302 | description: Client connections that are currently processing a transaction |
| 303 | unit: connections |
| 304 | chart_type: line |
| 305 | dimensions: |
| 306 | - name: client |
| 307 | - name: proxysql.questions_rate |
| 308 | description: Client requests / statements executed |
| 309 | unit: questions/s |
| 310 | chart_type: line |
| 311 | dimensions: |
| 312 | - name: questions |
| 313 | - name: proxysql.slow_queries_rate |
| 314 | description: Slow queries |
| 315 | unit: queries/s |
| 316 | chart_type: line |
| 317 | dimensions: |
| 318 | - name: slow |
| 319 | - name: proxysql.queries_rate |
| 320 | description: Queries rate |
| 321 | unit: queries/s |
| 322 | chart_type: stacked |
| 323 | dimensions: |
| 324 | - name: autocommit |
| 325 | - name: autocommit_filtered |
| 326 | - name: commit_filtered |
| 327 | - name: rollback |
| 328 | - name: rollback_filtered |
| 329 | - name: backend_change_user |
| 330 | - name: backend_init_db |
| 331 | - name: backend_set_names |
| 332 | - name: frontend_init_db |
| 333 | - name: frontend_set_names |
| 334 | - name: frontend_use_db |
| 335 | - name: proxysql.backend_statements_count |
| 336 | description: Statements available across all backend connections |
| 337 | unit: statements |
| 338 | chart_type: line |
| 339 | dimensions: |
| 340 | - name: total |
| 341 | - name: unique |
| 342 | - name: proxysql.backend_statements_rate |
| 343 | description: Statements executed against the backends |
| 344 | unit: statements/s |
| 345 | chart_type: stacked |
| 346 | dimensions: |
| 347 | - name: prepare |
| 348 | - name: execute |
| 349 | - name: close |
| 350 | - name: proxysql.client_statements_count |
| 351 | description: Statements that are in use by clients |
| 352 | unit: statements |
| 353 | chart_type: line |
| 354 | dimensions: |
| 355 | - name: total |
| 356 | - name: unique |
| 357 | - name: proxysql.client_statements_rate |
| 358 | description: Statements executed by clients |
| 359 | unit: statements/s |
| 360 | chart_type: stacked |
| 361 | dimensions: |
| 362 | - name: prepare |
| 363 | - name: execute |
| 364 | - name: close |
| 365 | - name: proxysql.cached_statements_count |
| 366 | description: Global prepared statements |
| 367 | unit: statements |
| 368 | chart_type: line |
| 369 | dimensions: |
| 370 | - name: cached |
| 371 | - name: proxysql.query_cache_entries_count |
| 372 | description: Query Cache entries |
| 373 | unit: entries |
| 374 | chart_type: line |
| 375 | dimensions: |
| 376 | - name: entries |
| 377 | - name: proxysql.query_cache_memory_used |
| 378 | description: Query Cache memory used |
| 379 | unit: B |
| 380 | chart_type: line |
| 381 | dimensions: |
| 382 | - name: used |
| 383 | - name: proxysql.query_cache_io |
| 384 | description: Query Cache I/O |
| 385 | unit: B/s |
| 386 | chart_type: line |
| 387 | dimensions: |
| 388 | - name: in |
| 389 | - name: out |
| 390 | - name: proxysql.query_cache_requests_rate |
| 391 | description: Query Cache requests |
| 392 | unit: requests/s |
| 393 | chart_type: line |
| 394 | dimensions: |
| 395 | - name: read |
| 396 | - name: write |
| 397 | - name: read_success |
| 398 | - name: proxysql.mysql_monitor_workers_count |
| 399 | description: MySQL monitor workers |
| 400 | unit: threads |
| 401 | chart_type: line |
| 402 | dimensions: |
| 403 | - name: workers |
| 404 | - name: auxiliary |
| 405 | - name: proxysql.mysql_monitor_workers_rate |
| 406 | description: MySQL monitor workers rate |
| 407 | unit: workers/s |
| 408 | chart_type: line |
| 409 | dimensions: |
| 410 | - name: started |
| 411 | - name: proxysql.mysql_monitor_connect_checks_rate |
| 412 | description: MySQL monitor connect checks |
| 413 | unit: checks/s |
| 414 | chart_type: line |
| 415 | dimensions: |
| 416 | - name: succeed |
| 417 | - name: failed |
| 418 | - name: proxysql.mysql_monitor_ping_checks_rate |
| 419 | description: MySQL monitor ping checks |
| 420 | unit: checks/s |
| 421 | chart_type: line |
| 422 | dimensions: |
| 423 | - name: succeed |
| 424 | - name: failed |
| 425 | - name: proxysql.mysql_monitor_read_only_checks_rate |
| 426 | description: MySQL monitor read only checks |
| 427 | unit: checks/s |
| 428 | chart_type: line |
| 429 | dimensions: |
| 430 | - name: succeed |
| 431 | - name: failed |
| 432 | - name: proxysql.mysql_monitor_replication_lag_checks_rate |
| 433 | description: MySQL monitor replication lag checks |
| 434 | unit: checks/s |
| 435 | chart_type: line |
| 436 | dimensions: |
| 437 | - name: succeed |
| 438 | - name: failed |
| 439 | - name: proxysql.jemalloc_memory_used |
| 440 | description: Jemalloc used memory |
| 441 | unit: B |
| 442 | chart_type: stacked |
| 443 | dimensions: |
| 444 | - name: active |
| 445 | - name: allocated |
| 446 | - name: mapped |
| 447 | - name: metadata |
| 448 | - name: resident |
| 449 | - name: retained |
| 450 | - name: proxysql.memory_used |
| 451 | description: Memory used |
| 452 | unit: B |
| 453 | chart_type: stacked |
| 454 | dimensions: |
| 455 | - name: auth |
| 456 | - name: sqlite3 |
| 457 | - name: query_digest |
| 458 | - name: query_rules |
| 459 | - name: firewall_users_table |
| 460 | - name: firewall_users_config |
| 461 | - name: firewall_rules_table |
| 462 | - name: firewall_rules_config |
| 463 | - name: mysql_threads |
| 464 | - name: admin_threads |
| 465 | - name: cluster_threads |
| 466 | - name: proxysql.uptime |
| 467 | description: Uptime |
| 468 | unit: seconds |
| 469 | chart_type: line |
| 470 | dimensions: |
| 471 | - name: uptime |
| 472 | - name: command |
| 473 | description: These metrics refer to the SQL command. |
| 474 | labels: |
| 475 | - name: command |
| 476 | description: SQL command. |
| 477 | metrics: |
| 478 | - name: proxysql.mysql_command_execution_rate |
| 479 | description: MySQL command execution |
| 480 | unit: seconds |
| 481 | chart_type: line |
| 482 | dimensions: |
| 483 | - name: uptime |
| 484 | - name: proxysql.mysql_command_execution_time |
| 485 | description: MySQL command execution time |
| 486 | unit: microseconds |
| 487 | chart_type: line |
| 488 | dimensions: |
| 489 | - name: time |
| 490 | - name: proxysql.mysql_command_execution_duration |
| 491 | description: MySQL command execution duration histogram |
| 492 | unit: microseconds |
| 493 | chart_type: stacked |
| 494 | dimensions: |
| 495 | - name: 100us |
| 496 | - name: 500us |
| 497 | - name: 1ms |
| 498 | - name: 5ms |
| 499 | - name: 10ms |
| 500 | - name: 50ms |
| 501 | - name: 100ms |
| 502 | - name: 500ms |
| 503 | - name: 1s |
| 504 | - name: 5s |
| 505 | - name: 10s |
| 506 | - name: +Inf |
| 507 | - name: user |
| 508 | description: These metrics refer to the user. |
| 509 | labels: |
| 510 | - name: user |
| 511 | description: username from the mysql_users table |
| 512 | metrics: |
| 513 | - name: proxysql.mysql_user_connections_utilization |
| 514 | description: MySQL user connections utilization |
| 515 | unit: percentage |
| 516 | chart_type: line |
| 517 | dimensions: |
| 518 | - name: used |
| 519 | - name: proxysql.mysql_user_connections_count |
| 520 | description: MySQL user connections used |
| 521 | unit: connections |
| 522 | chart_type: line |
| 523 | dimensions: |
| 524 | - name: used |
| 525 | - name: hostgroup |
| 526 | description: These metrics refer to the backends hostgroup. |
| 527 | labels: |
| 528 | - name: hostgroup |
| 529 | description: hostgroup identifier |
| 530 | metrics: |
| 531 | - name: proxysql.hostgroup_backends_status |
| 532 | description: Hostgroup backends count in each status |
| 533 | unit: backends |
| 534 | chart_type: line |
| 535 | dimensions: |
| 536 | - name: online |
| 537 | - name: shunned |
| 538 | - name: offline_soft |
| 539 | - name: offline_hard |
| 540 | - name: backend |
| 541 | description: These metrics refer to the backend server. |
| 542 | labels: |
| 543 | - name: hostgroup |
| 544 | description: backend server hostgroup |
| 545 | - name: host |
| 546 | description: backend server host |
| 547 | - name: port |
| 548 | description: backend server port |
| 549 | metrics: |
| 550 | - name: proxysql.backend_status |
| 551 | description: Backend status |
| 552 | unit: status |
| 553 | chart_type: line |
| 554 | dimensions: |
| 555 | - name: online |
| 556 | - name: shunned |
| 557 | - name: offline_soft |
| 558 | - name: offline_hard |
| 559 | - name: proxysql.backend_connections_usage |
| 560 | description: Backend connections usage |
| 561 | unit: connections |
| 562 | chart_type: line |
| 563 | dimensions: |
| 564 | - name: free |
| 565 | - name: used |
| 566 | - name: proxysql.backend_connections_rate |
| 567 | description: Backend connections established |
| 568 | unit: connections/s |
| 569 | chart_type: line |
| 570 | dimensions: |
| 571 | - name: succeed |
| 572 | - name: failed |
| 573 | - name: proxysql.backend_queries_rate |
| 574 | description: Backend queries |
| 575 | unit: queries/s |
| 576 | chart_type: line |
| 577 | dimensions: |
| 578 | - name: queries |
| 579 | - name: proxysql.backend_traffic |
| 580 | description: Backend traffic |
| 581 | unit: B/s |
| 582 | chart_type: line |
| 583 | dimensions: |
| 584 | - name: recv |
| 585 | - name: send |
| 586 | - name: proxysql.backend_latency |
| 587 | description: Backend latency |
| 588 | unit: microseconds |
| 589 | chart_type: line |
| 590 | dimensions: |
| 591 | - name: latency |