Plugin: go.d.plugin Module: proxysql
This collector monitors ProxySQL servers.
This collector is supported on all platforms.
This collector supports collecting metrics from multiple instances of this integration, including remote instances.
This integration doesn’t support auto-detection.
The default configuration for this integration does not impose any limits on data collection.
The default configuration for this integration is not expected to impose a significant performance impact on the system.
You can configure the proxysql collector in two ways:
| Method | Best for | How to |
|---|---|---|
| UI | Fast setup without editing files | Go to Nodes → Configure this node → Collectors → Jobs, search for proxysql, then click + to add a job. |
| File | If you prefer configuring via file, or need to automate deployments (e.g., with Ansible) | Edit go.d/proxysql.conf and add a job. |
Important
UI configuration requires paid Netdata Cloud plan.
No action required.
The following options can be defined globally: update_every, autodetection_retry.
| Group | Option | Description | Default | Required |
|---|---|---|---|---|
| Collection | update_every | Data collection frequency (seconds). | 1 | no |
| autodetection_retry | Autodetection retry interval (seconds). Set 0 to disable. | 0 | no | |
| Target | dsn | ProxySQL server DSN (Data Source Name). See DSN syntax. | stats:stats@tcp(127.0.0.1:6032)/ | yes |
| timeout | Query timeout (seconds). | 1 | no | |
| Functions | functions.top_queries.disabled | Disable the top-queries function. | no | no |
| functions.top_queries.timeout | Query timeout (seconds). Uses collector timeout if not set. | no | ||
| functions.top_queries.limit | Maximum number of queries to return. | 500 | no | |
| Virtual Node | vnode | Associates this data collection job with a Virtual Node. | no |
Configure the proxysql collector from the Netdata web interface:
The configuration file name for this integration is go.d/proxysql.conf.
The file format is YAML. Generally, the structure is:
update_every: 1
autodetection_retry: 0
jobs:
- name: some_name1
- name: some_name2
You can edit the configuration file using the edit-config script from the
Netdata config directory.
cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/proxysql.conf
An example configuration.
jobs:
- name: local
dsn: stats:stats@tcp(127.0.0.1:6032)/
An example configuration.
jobs:
- name: local
my.cnf: '/etc/my.cnf'
Note
When you define multiple jobs, their names must be unique.
Local and remote instances.
jobs:
- name: local
dsn: stats:stats@tcp(127.0.0.1:6032)/
- name: remote
dsn: stats:stats@tcp(203.0.113.0:6032)/
Metrics grouped by scope.
The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
These metrics refer to the entire monitored application.
This scope has no labels.
Metrics:
| Metric | Description | Dimensions | Unit |
|---|---|---|---|
| proxysql.client_connections_count | Client connections | connected, non_idle, hostgroup_locked | connections |
| proxysql.client_connections_rate | Client connections rate | created, aborted | connections/s |
| proxysql.server_connections_count | Server connections | connected | connections |
| proxysql.server_connections_rate | Server connections rate | created, aborted, delayed | connections/s |
| proxysql.backends_traffic | Backends traffic | recv, sent | B/s |
| proxysql.clients_traffic | Clients traffic | recv, sent | B/s |
| proxysql.active_transactions_count | Client connections that are currently processing a transaction | client | connections |
| proxysql.questions_rate | Client requests / statements executed | questions | questions/s |
| proxysql.slow_queries_rate | Slow queries | slow | queries/s |
| proxysql.queries_rate | Queries rate | autocommit, autocommit_filtered, commit_filtered, rollback, rollback_filtered, backend_change_user, backend_init_db, backend_set_names, frontend_init_db, frontend_set_names, frontend_use_db | queries/s |
| proxysql.backend_statements_count | Statements available across all backend connections | total, unique | statements |
| proxysql.backend_statements_rate | Statements executed against the backends | prepare, execute, close | statements/s |
| proxysql.client_statements_count | Statements that are in use by clients | total, unique | statements |
| proxysql.client_statements_rate | Statements executed by clients | prepare, execute, close | statements/s |
| proxysql.cached_statements_count | Global prepared statements | cached | statements |
| proxysql.query_cache_entries_count | Query Cache entries | entries | entries |
| proxysql.query_cache_memory_used | Query Cache memory used | used | B |
| proxysql.query_cache_io | Query Cache I/O | in, out | B/s |
| proxysql.query_cache_requests_rate | Query Cache requests | read, write, read_success | requests/s |
| proxysql.mysql_monitor_workers_count | MySQL monitor workers | workers, auxiliary | threads |
| proxysql.mysql_monitor_workers_rate | MySQL monitor workers rate | started | workers/s |
| proxysql.mysql_monitor_connect_checks_rate | MySQL monitor connect checks | succeed, failed | checks/s |
| proxysql.mysql_monitor_ping_checks_rate | MySQL monitor ping checks | succeed, failed | checks/s |
| proxysql.mysql_monitor_read_only_checks_rate | MySQL monitor read only checks | succeed, failed | checks/s |
| proxysql.mysql_monitor_replication_lag_checks_rate | MySQL monitor replication lag checks | succeed, failed | checks/s |
| proxysql.jemalloc_memory_used | Jemalloc used memory | active, allocated, mapped, metadata, resident, retained | B |
| proxysql.memory_used | Memory used | auth, sqlite3, query_digest, query_rules, firewall_users_table, firewall_users_config, firewall_rules_table, firewall_rules_config, mysql_threads, admin_threads, cluster_threads | B |
| proxysql.uptime | Uptime | uptime | seconds |
These metrics refer to the SQL command.
Labels:
| Label | Description |
|---|---|
| command | SQL command. |
Metrics:
| Metric | Description | Dimensions | Unit |
|---|---|---|---|
| proxysql.mysql_command_execution_rate | MySQL command execution | uptime | seconds |
| proxysql.mysql_command_execution_time | MySQL command execution time | time | microseconds |
| proxysql.mysql_command_execution_duration | MySQL command execution duration histogram | 100us, 500us, 1ms, 5ms, 10ms, 50ms, 100ms, 500ms, 1s, 5s, 10s, +Inf | microseconds |
These metrics refer to the user.
Labels:
| Label | Description |
|---|---|
| user | username from the mysql_users table |
Metrics:
| Metric | Description | Dimensions | Unit |
|---|---|---|---|
| proxysql.mysql_user_connections_utilization | MySQL user connections utilization | used | percentage |
| proxysql.mysql_user_connections_count | MySQL user connections used | used | connections |
These metrics refer to the backends hostgroup.
Labels:
| Label | Description |
|---|---|
| hostgroup | hostgroup identifier |
Metrics:
| Metric | Description | Dimensions | Unit |
|---|---|---|---|
| proxysql.hostgroup_backends_status | Hostgroup backends count in each status | online, shunned, offline_soft, offline_hard | backends |
These metrics refer to the backend server.
Labels:
| Label | Description |
|---|---|
| hostgroup | backend server hostgroup |
| host | backend server host |
| port | backend server port |
Metrics:
| Metric | Description | Dimensions | Unit |
|---|---|---|---|
| proxysql.backend_status | Backend status | online, shunned, offline_soft, offline_hard | status |
| proxysql.backend_connections_usage | Backend connections usage | free, used | connections |
| proxysql.backend_connections_rate | Backend connections established | succeed, failed | connections/s |
| proxysql.backend_queries_rate | Backend queries | queries | queries/s |
| proxysql.backend_traffic | Backend traffic | recv, send | B/s |
| proxysql.backend_latency | Backend latency | latency | microseconds |
The following alerts are available:
| Alert name | On metric | Description |
|---|---|---|
| proxysql_hostgroup_no_online_backends | proxysql.hostgroup_backends_status | ProxySQL hostgroup ${label:hostgroup} has no ONLINE backends |
| proxysql_backend_shunned | proxysql.backend_status | ProxySQL backend SHUNNED (${label:host}:${label:port} hostgroup ${label:hostgroup}) |
| proxysql_backend_offline_hard | proxysql.backend_status | ProxySQL backend OFFLINE_HARD (${label:host}:${label:port} hostgroup ${label:hostgroup}) |
Important: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.
To troubleshoot issues with the proxysql collector, run the go.d.plugin with the debug option enabled. The output
should give you clues as to why the collector isn’t working.
Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that’s not the case on
your system, open netdata.conf and look for the plugins setting under [directories].
cd /usr/libexec/netdata/plugins.d/
Switch to the netdata user.
sudo -u netdata -s
Run the go.d.plugin to debug the collector:
./go.d.plugin -d -m proxysql
To debug a specific job:
./go.d.plugin -d -m proxysql -j jobName
If you’re encountering problems with the proxysql collector, follow these steps to retrieve logs and identify potential issues:
Use the following command to view logs generated since the last Netdata service restart:
journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep proxysql
Locate the collector log file, typically at /var/log/netdata/collector.log, and use grep to filter for collector’s name:
grep proxysql /var/log/netdata/collector.log
Note: This method shows logs from all restarts. Focus on the latest entries for troubleshooting current issues.
If your Netdata runs in a Docker container named “netdata” (replace if different), use this command:
docker logs netdata 2>&1 | grep proxysql
Want a personalised demo of Netdata for your use case?