Prometheus exporter
ProxySQL includes a built in Prometheus exporter. This exporter let’s you expose and consume relevant system metrics through a friendly interface.
Admin variables
- admin-restapi_enabled:
- Description: Enable or disables the metrics endpoint.
- Default value:
false
- admin-restapi_port:
- Description: Port in which metrics endpoint is going to be exposed.
- Default value:
6070
- admin-prometheus_memory_metrics_interval:
- Description: Internal interval in which memory metrics are going to be collected.
- Default value: 61
Configuration
ProxySQL is always collecting metrics since startup, but metrics endpoint is disabled by default, to enable it and expose this metrics you need to log into the admin console and:
``` SET admin-restapi_enabled='true';
LOAD ADMIN VARIABLES TO RUNTIME;
</p>
Optionally you can also change the other default values in case of need:
<p>
SET admin-restapi_port=‘6070’; SET admin-prometheus_memory_metrics_interval=‘60’;
LOAD ADMIN VARIABLES TO RUNTIME;
</p>
Or place the following lines in your config file:
admin_variables= { … restapi_enabled=true restapi_port=6070 prometheus_memory_metrics_interval=60 … }
### Important Notes
#### `admin-restapi_port` collision:
Multiple instances of ProxySQL should have different `restapi_ports` otherwise ProxySQL won't
be able to start the service responsible for exposing the metrics endpoint, this will be reflected
in the logs with the following message:
<p>
Unable to start ‘ProxySQL_RestAPI_Server’, port ‘%port_number%’ already in use.\n
</p>
In case this event happened, for re-activating the service at runtime, the user should:
1. Switch the service off: `SET admin-restapi_enabled='false'; LOAD ADMIN VARIABLES TO RUNTIME;`.
2. Change the port to a new desired free one: `SET admin-restapi_port='new_free_port_number'`.
3. Switch the service on again: `SET admin-restapi_enabled='true'; LOAD ADMIN VARIABLES TO RUNTIME;`.
#### Performance considerations:
Most of metrics are collected by ProxySQL in each of it's modules in the form of local counters during
regular operation, as it was previously done. In this sense, internal metrics harvest hasn't change at all.
On the other hand, the actual Prometheus counters exposed through the 'RestAPI' or the 'Admin Interface'
are updated 'on-demand', essentially, internal counters are scrapped and exposed when either endpoint is queried.
This is done for all metrics, with the exception of `memory_metrics`, which defines their own internal,
through the 'admin-variable' `admin-prometheus_memory_metrics_interval` due to their higher performance hit.
Metrics polling should be very fast, and shouldn't affect normal ProxySQL operation at all or being noticeable.
With all this, due to the potential increase in size on the Prometheus end of the time series exposed, and
the nature of the metrics being exposed we **do not recommend** sub-second `scrapping_intervals`.
#### Frontend ping metric:
The MySQL status counter `Com_frontend_ping` is exported as:
```text
proxysql_com_frontend_ping_total{protocol="mysql"}
It is a counter of regular frontend MySQL COM_PING packets received from clients. Each successful ping on
the normal idle/command-ready path increments both Com_frontend_ping in
stats_mysql_global and this
Prometheus series once. The protocol="mysql" label distinguishes the protocol while the _total suffix
identifies a cumulative counter.
Naming:
Prometheus metrics names used by ProxySQL follow several conventions recommended by Prometheus style guide, and are
also verified against promtool checker. This ensures that all ProxySQL metrics are compatible with OpenMetrics format.
Released metric catalog
The catalog below is the complete metric-family union audited at releases v3.0.10, v3.1.10, and v4.0.10. The two GenAI families are registered only when the v4.0.10 GenAI plugin is loaded. A family appears once even when ProxySQL registers several child series for fixed label values. The Labels and values column lists all fixed values established by source plus dynamic label keys added when a backend, cluster node, error, or build is observed. Type is the type declared at family registration; it is authoritative even where a historical metric name or help text suggests another shape.
Connection pools and hostgroups
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
mysql_error_total | counter | Tracks the mysql errors encountered. | hostgroup; address; port; code |
pgsql_error_total | counter | Tracks the pgsql errors encountered. | hostgroup; address; port; code |
proxysql_access_denied_max_connections_total | counter | Total access denied “max connections”. | protocol={mysql,pgsql} |
proxysql_access_denied_max_user_connections_total | counter | Total access denied “max user connections”. | protocol={mysql,pgsql} |
proxysql_access_denied_wrong_password_total | counter | Total access denied “wrong password”. | protocol={mysql,pgsql} |
proxysql_client_connections_connected | gauge | Client connections that are currently connected. | protocol={mysql,pgsql} |
proxysql_client_connections_connected_additional | gauge | Client connections that are currently connected using additional password. | None |
proxysql_client_connections_connected_primary | gauge | Client connections that are currently connected using primary password. | None |
proxysql_client_connections_sha2cached_total | counter | Total number of attempted client connections with known cached passwords. | None |
proxysql_client_connections_total | counter | Total number of client connections created. | status={created,aborted}; protocol={mysql,pgsql} |
proxysql_com_autocommit_filtered_total | counter | Total queries filtered autocommit. | None |
proxysql_com_autocommit_total | counter | Total queries autocommited. | None |
proxysql_com_backend_change_user_total | counter | Total CHANGE_USER queries backend. | None |
proxysql_com_backend_init_db_total | counter | Total queries backend INIT DB. | None |
proxysql_com_backend_reset_connection_total | counter | Total backend_reset_connection queries backend. | None |
proxysql_com_backend_set_client_encoding_total | counter | Total queries backend SET client_encoding. | None |
proxysql_com_backend_set_names_total | counter | Total queries backend SET NAMES. | None |
proxysql_com_commit_cnt_filtered_total | counter | Total queries commit filtered. | None |
proxysql_com_commit_cnt_total | counter | Total queries commit. | None |
proxysql_com_frontend_init_db_total | counter | Total INIT DB queries frontend. | None |
proxysql_com_frontend_set_client_encoding_total | counter | Total SET client_encoding frontend queries. | None |
proxysql_com_frontend_set_names_total | counter | Total SET NAMES frontend queries. | None |
proxysql_com_frontend_use_db_total | counter | Total USE DB queries frontend. | None |
proxysql_com_rollback_filtered_total | counter | Total queries filtered rollbacked. | None |
proxysql_com_rollback_total | counter | Total queries rollbacked. | None |
proxysql_connpool_conns | gauge | How many backend connections are currently (free|used). | status={free,used}; protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_connpool_conns_latency_us | gauge | The currently ping time in microseconds, as reported from Monitor. | protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_connpool_conns_queries_total | counter | The number of queries routed towards this particular backend server. | protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_connpool_conns_status | gauge | The status of the backend server (1 - ONLINE, 2 - SHUNNED, 3 - OFFLINE_SOFT, 4 - OFFLINE_HARD, 5 - SHUNNED_REPLICATION_LAG, 6 - SHUNNED_AWS_BGD). | protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_connpool_conns_total | counter | How many connections have been tried to be established. | status={err,ok}; protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_connpool_data_bytes_total | counter | Amount of data (sent|recv) from the backend, excluding metadata. | traffic_flow={recv,sent}; protocol={mysql,pgsql}; endpoint; hostgroup |
proxysql_gtid_executed_total | counter | Tracks the number of executed gtid per host and port. | hostname; port |
proxysql_myhgm_auto_increment_multiplex_total | counter | The number of times that ‘auto_increment_delay_multiplex’ has been triggered. | None |
proxysql_myhgm_myconnpool_destroy_total | counter | The number of connections considered unhealthy and therefore closed. | None |
proxysql_myhgm_myconnpool_get_ok_total | counter | The number of successful requests to the connection pool (i.e. where a connection was available). | None |
proxysql_myhgm_myconnpool_get_ping_total | counter | The number of connections that were taken from the pool to run a ping to keep them alive. | None |
proxysql_myhgm_myconnpool_get_total | counter | The number of requests made to the connection pool. | None |
proxysql_myhgm_myconnpool_push_total | counter | The number of connections returned to the connection pool. | None |
proxysql_myhgm_myconnpool_reset_total | counter | The number of connections that have been reset / re-initialized using “COM_CHANGE_USER” | None |
proxysql_mysql_error_total | counter | Tracks the mysql errors generated by proxysql. | hostgroup; address; port; code |
proxysql_pghgm_myconnpool_get_ping_total | counter | The number of connections that were taken from the pool to run a ping to keep them alive. | None |
proxysql_pghgm_pgconnpool_destroy_total | counter | The number of connections considered unhealthy and therefore closed. | None |
proxysql_pghgm_pgconnpool_get_ok_total | counter | The number of successful requests to the connection pool (i.e. where a connection was available). | None |
proxysql_pghgm_pgconnpool_get_total | counter | The number of requests made to the connection pool. | None |
proxysql_pghgm_pgconnpool_push_total | counter | The number of connections returned to the connection pool. | None |
proxysql_pghgm_pgconnpool_reset_total | counter | The number of connections that have been reset / re-initialized using “COM_CHANGE_USER” | None |
proxysql_pgsql_error_total | counter | Tracks the pgsql errors generated by proxysql. | hostgroup; address; port; code |
proxysql_selects_for_update__autocommit0_total | counter | Total queries that are SELECT for update or equivalent. | None |
proxysql_server_connections_connected | gauge | Backend connections that are currently connected. | protocol={mysql,pgsql} |
proxysql_server_connections_total | counter | Total number of server connections (created|delayed|aborted). | status={created,delayed,aborted}; protocol={mysql,pgsql} |
proxysql_servers_table_version_total | counter | Number of times the “servers_table” have been modified. | None |
Query processing and sessions
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_active_transactions | gauge | Provides a count of how many client connection are currently processing a transaction. | protocol=mysql |
proxysql_automatic_detected_sql_injection_total | counter | Blocked a detected ‘sql injection’ attempt. | protocol=mysql |
proxysql_aws_aurora_replicas_skipped_during_query_total | counter | Replicas skipped due to current lag being higher than ‘max_lag’ annotation. | protocol=mysql |
proxysql_backend_lagging_during_query_total | counter | Query failed because server was shunned due to lag. | protocol=mysql |
proxysql_backend_offline_during_query_total | counter | Query failed because server was offline. | protocol=mysql |
proxysql_backend_query_time_seconds_total | counter | Time spent making network calls to communicate with the backends. | protocol=mysql |
proxysql_client_connections_hostgroup_locked | gauge | Number of client connection locked to a specific hostgroup. | protocol=mysql |
proxysql_client_connections_non_idle | gauge | Number of client connections that are currently handled by the main worker threads. | protocol=mysql |
proxysql_client_host_error_killed_connections | counter | Killed client connections because address exceeded ‘client_host_error_counts’. | protocol=mysql |
proxysql_com_backend_stmt_total | counter | Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by ProxySQL against the backends. | protocol=mysql; op={prepare,execute,close} |
proxysql_com_frontend_ping_total | counter | ’COM_PING’ received from the client. | protocol=mysql |
proxysql_com_frontend_stmt_total | counter | Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by clients. | protocol=mysql; op={prepare,execute,close} |
proxysql_connpool_get_conn_failure_total | counter | The connection pool cannot provide any connection. | protocol=mysql |
proxysql_connpool_get_conn_success_immediate_total | counter | The connection is provided from per-thread cache. | protocol=mysql |
proxysql_connpool_get_conn_success_latency_awareness_total | counter | The connection was picked using the latency awareness algorithm. | protocol=mysql |
proxysql_connpool_get_conn_success_total | counter | The session is able to get a connection, either from per-thread cache or connection pool. | protocol=mysql |
proxysql_generated_error_packets_total | counter | Total generated error packets. | protocol=mysql |
proxysql_gtid_consistent_queries_total | counter | Total queries with GTID consistent read. | protocol=mysql |
proxysql_gtid_session_collected_total | counter | Total queries with GTID session state. | protocol=mysql |
proxysql_hostgroup_locked_queries_total | counter | Query blocked because connection is locked into some hostgroup but is trying to reach other. | protocol=mysql |
proxysql_hostgroup_locked_set_cmds_total | counter | Total number of connections that have been locked in a hostgroup. | protocol=mysql |
proxysql_max_connect_timeouts_total | counter | Maximum connection timeout reached when trying to connect to backend sever. | protocol=mysql |
proxysql_mirror_concurrency | gauge | Mirror current concurrency | protocol=mysql |
proxysql_mirror_queue_lengths | gauge | Mirror queue length | protocol=mysql |
proxysql_monitor_replication_lag_group_by_host | gauge | Encodes different replication lag check if the same server is in multiple hostgroups. | protocol=mysql |
proxysql_mysql_backend_buffers_bytes | gauge | Buffers related to backend connections if “fast_forward” is used (0 means fast_forward is not used). | protocol=mysql |
proxysql_mysql_frontend_buffers_bytes | gauge | Buffers related to frontend connections (read/write buffers and other queues). | protocol=mysql |
proxysql_mysql_killed_backend_connections_total | counter | Number of backend connection killed. | protocol=mysql |
proxysql_mysql_killed_backend_queries_total | counter | Killed backend queries. | protocol=mysql |
proxysql_mysql_max_connections | gauge | The maximum number of client connections that the proxy can handle. | protocol=mysql |
proxysql_mysql_monitor_aws_rds_topology_discovery_interval | gauge | How frequently a topology discovery is performed, e.g. a value of 500 means one topology discovery every 500 read-only checks | protocol=mysql |
proxysql_mysql_monitor_enabled | gauge | Enables or disables MySQL Monitor. | protocol=mysql |
proxysql_mysql_monitor_history_timeout_seconds | gauge | The duration for which the events for the checks made by the Monitor module are kept, in seconds. | protocol=mysql |
proxysql_mysql_monitor_ping_interval | gauge | How frequently a ping check is performed, in seconds. | protocol=mysql |
proxysql_mysql_monitor_ping_max_failures | gauge | Reached maximum ping attempts from monitor. | protocol=mysql |
proxysql_mysql_monitor_ping_timeout_seconds | gauge | Ping timeout in seconds. | protocol=mysql |
proxysql_mysql_monitor_read_only_interval_seconds | gauge | How frequently a read only check is performed, in seconds. | protocol=mysql |
proxysql_mysql_monitor_read_only_timeout_seconds | gauge | Read only check timeout in seconds. | protocol=mysql |
proxysql_mysql_monitor_replication_lag_interval_seconds | gauge | How frequently a replication lag check is performed, in seconds. | protocol=mysql |
proxysql_mysql_monitor_replication_lag_timeout_seconds | gauge | Replication lag check timeout in seconds. | protocol=mysql |
proxysql_mysql_monitor_writer_is_also_reader | gauge | Encodes different behaviors for nodes depending on their ‘READ_ONLY’ flag value. | protocol=mysql |
proxysql_mysql_session_internal_bytes | gauge | Other memory used by ProxySQL to handle MySQL Sessions. | protocol=mysql |
proxysql_mysql_set_wait_timeout_commands_total | counter | Number of SET wait_timeout commands received from clients. | protocol=mysql |
proxysql_mysql_thread_workers | gauge | Number of MySQL Thread workers i.e. ‘mysql-threads’ | protocol=mysql |
proxysql_mysql_timeout_terminated_connections_total | counter | Number of client connections terminated due to wait_timeout. | protocol=mysql |
proxysql_mysql_unexpected_frontend_com_ping_total | counter | Unexpected ‘COM_PING’ received from the client. | protocol=mysql |
proxysql_mysql_unexpected_frontend_com_quit_total | counter | Unexpected ‘COM_QUIT’ received from the client. | protocol=mysql |
proxysql_mysql_unexpected_frontend_packets_total | counter | Unexpected packet received from client. | protocol=mysql |
proxysql_mysql_wait_timeout | gauge | If a proxy session has been idle for more than this threshold, the proxy will kill the session. | protocol=mysql |
proxysql_mysql_whitelisted_sqli_fingerprint_total | counter | Detected a whitelisted ‘sql injection’ fingerprint. | protocol=mysql |
proxysql_queries_backends_bytes_total | counter | Total number of bytes (sent|received) in backend connections. | protocol=mysql; traffic_flow={sent,received} |
proxysql_queries_frontends_bytes_total | counter | Total number of bytes (sent|received) in frontend connections. | protocol=mysql; traffic_flow={sent,received} |
proxysql_queries_with_max_lag__delayed_total | counter | Query delayed because no connection was selected due to ‘max_lag’ annotation. | protocol=mysql |
proxysql_queries_with_max_lag__total_wait_time_total | counter | Total waited time due to connection selection because of ‘max_lag’ annotation. | protocol=mysql |
proxysql_queries_with_max_lag_total | counter | Received queries that have a ‘max_lag’ attribute. | protocol=mysql |
proxysql_query_processor_time_seconds_total | counter | The time spent inside the “Query Processor” to determine what action needs to be taken with the query (internal module). | protocol=mysql |
proxysql_questions_total | counter | The total number of client requests / statements executed. | protocol=mysql |
proxysql_slow_queries_total | counter | The total number of queries with an execution time greater than “mysql-long_query_time” milliseconds. | protocol=mysql |
MySQL Monitor
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_mysql_monitor_connect_check_total | counter | Number of (succeed|failed) ‘connect checks’ from ‘monitor_connect_thread’. | status={ok,err} |
proxysql_mysql_monitor_dns_cache_lookup_success | counter | Number of dns queried ‘dns_cache_lookup_success’ from ‘monitor_dns_resolver_thread’. | None |
proxysql_mysql_monitor_dns_cache_queried | counter | Number of dns queried ‘dns_cache_queried’ from ‘monitor_dns_resolver_thread’. | None |
proxysql_mysql_monitor_dns_cache_record_updated | counter | Number of dns queried ‘dns_cache_record_updated’ from ‘monitor_dns_resolver_thread’. | None |
proxysql_mysql_monitor_ping_check_total | counter | Number of (succeed|failed) ‘ping checks’ from ‘monitor_ping_thread’. | status={ok,err} |
proxysql_mysql_monitor_read_only_check_total | counter | Number of (succeed|failed) ‘read only checks’ from ‘monitor_read_only_thread’. | status={ok,err} |
proxysql_mysql_monitor_replication_lag_check_total | counter | Number of (succeed|failed)‘replication lag checks’ from ‘monitor_replication_lag_thread’. | status={ok,err} |
proxysql_mysql_monitor_workers | gauge | Number of monitor workers threads. | None |
proxysql_mysql_monitor_workers_aux | gauge | Number of auxiliary monitor threads. | None |
proxysql_mysql_monitor_workers_started_total | counter | Number of MySQL Monitor workers started. | None |
Query cache
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_query_cache_bytes_total | counter | Number of bytes (read|written) into the Query Cache. | op={written,read}; protocol={mysql,pgsql} |
proxysql_query_cache_count_get_total | counter | Number of failed read requests. | status={err,ok}; protocol={mysql,pgsql} |
proxysql_query_cache_count_set_total | counter | Number of write requests. | protocol={mysql,pgsql} |
proxysql_query_cache_entries_total | counter | Number of entries currently stored in the query cache. | protocol={mysql,pgsql} |
proxysql_query_cache_memory_bytes | gauge | Memory currently used by the query cache. | protocol={mysql,pgsql} |
proxysql_query_cache_purged_total | counter | Number of entries purged by the Query Cache due to TTL expiration. | protocol={mysql,pgsql} |
Query-event loggers
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_mysql_logger_circular_buffer_events | gauge | Number of events currently present in the circular buffer. | None |
proxysql_mysql_logger_circular_buffer_events_total | counter | The total number of events added/dropped to/from the circular buffer. | type={added,dropped} |
proxysql_mysql_logger_copy_seconds_total | counter | Total time spent copying events to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_mysql_logger_copy_total | counter | Number of times events were copied to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_mysql_logger_events_copied_total | counter | Total number of events copied to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_mysql_logger_get_all_events_calls_total | counter | Number of times the ‘get_all_events’ method was called. | None |
proxysql_mysql_logger_get_all_events_events_total | counter | Number of events retrieved by the get_all_events method. | None |
proxysql_mysql_logger_get_all_events_seconds_total | counter | Total time spent in get_all_events method. | None |
proxysql_pgsql_logger_circular_buffer_events | gauge | Number of events currently present in the circular buffer. | None |
proxysql_pgsql_logger_circular_buffer_events_total | counter | The total number of events added/dropped to/from the circular buffer. | type={added,dropped} |
proxysql_pgsql_logger_copy_seconds_total | counter | Total time spent copying events to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_pgsql_logger_copy_total | counter | Number of times events were copied to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_pgsql_logger_events_copied_total | counter | Total number of events copied to the in-memory/on-disk databases. | target={memory,disk} |
proxysql_pgsql_logger_get_all_events_calls_total | counter | Number of times the ‘get_all_events’ method was called. | None |
proxysql_pgsql_logger_get_all_events_events_total | counter | Number of events retrieved by the get_all_events method. | None |
proxysql_pgsql_logger_get_all_events_seconds_total | counter | Total time spent in get_all_events method. | None |
proxysql_query_logger_logged_queries_total | counter | Total number of queries accepted by protocol query loggers. | protocol={mysql,pgsql} |
Admin, process, and memory
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
prepare_stmt_backend_memory_bytes | gauge | Memory used by backend server related to prepare statements. | None |
prepare_stmt_metadata_memory_bytes | gauge | Memory used to store meta data related to prepare statements. | None |
proxysql_auth_memory_bytes | gauge | Memory used by the authentication module to store user credentials and attributes. | None |
proxysql_connpool_memory_bytes | gauge | Memory used by the connection pool to store connections metadata. | None |
proxysql_fds_in_use | gauge | The number of file descriptors currently in use by ProxySQL. | None |
proxysql_jemalloc_allocated_bytes_total | counter | Bytes allocated by the application. | None |
proxysql_jemalloc_bytes | gauge | Jemalloc memory usage stadistics (resident|active|mapped|metadata). | type={resident,active,mapped,metadata,retained} |
proxysql_mysql_firewall_rules_config_bytes | gauge | Full ‘mysql_firewall_users’ config ‘resultset’ size. | None |
proxysql_mysql_firewall_rules_table_bytes | gauge | Number of bytes used by ‘mysql_firewall_rules’ entries. | None |
proxysql_mysql_firewall_users_config_bytes | gauge | Full ‘mysql_firewall_users’ config ‘resultset’ size. | None |
proxysql_mysql_firewall_users_table_bytes | gauge | Number of bytes used by ‘mysql_firewall_users’ entries. | None |
proxysql_mysql_listener_paused | gauge | MySQL listener paused because of PROXYSQL PAUSE. | None |
proxysql_mysql_query_rules_memory_bytes | gauge | Number of bytes used by ‘mysql_query_rules’ rules. | None |
proxysql_pgsql_listener_paused | gauge | PgSQL listener paused because of PROXYSQL PAUSE. | None |
proxysql_query_digest_memory_bytes | gauge | Memory used to store data related to stats_mysql_query_digest. | None |
proxysql_servers_clients_status_last_seen_at | gauge | Last time a query was executed in the local Admin interface by the remote ProxySQL instance. | uuid; hostname; port |
proxysql_sqlite3_memory_bytes | gauge | Memory used by SQLite. | None |
proxysql_stack_memory_admin_threads_bytes | gauge | Stack size used by ‘admin_threads’. | None |
proxysql_stack_memory_cluster_threads | gauge | Stack size used by ‘cluster_threads’. | None |
proxysql_stack_memory_mysql_threads_bytes | gauge | Stack size used by ‘mysql_threads’. | None |
proxysql_stmt_cached | gauge | This is the number of global prepared statements for which proxysql has metadata. | None |
proxysql_stmt_client_active | gauge | The total number of prepared statements that are in use by clients. | None |
proxysql_stmt_client_active_unique | gauge | This variable tracks the number of unique prepared statements currently in use by clients. | None |
proxysql_stmt_max_stmt_id | gauge | When a new global prepared statement is created, a new “stmt_id” is used. Stmt_Max_Stmt_id represents the maximum “stmt_id” ever used. | None |
proxysql_stmt_server_active | gauge | The total number of prepared statements currently available across all backend connections. | None |
proxysql_stmt_server_active_unique | gauge | The number of unique prepared statements currently available across all backend connections. | None |
proxysql_uptime_seconds_total | counter | The total uptime of ProxySQL. | None |
proxysql_version_info | gauge | ProxySQL version. | version; version_comment |
Cluster
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_cluster_pulled_total | counter | Number of times a ‘module’ have been pulled from a peer. | module_name={mysql_query_rules,mysql_servers,mysql_servers_replication_hostgroups,mysql_servers_group_replication_hostgroups,mysql_servers_galera_hostgroups,mysql_servers_aws_aurora_hostgroups,mysql_servers_hostgroup_attributes,mysql_servers_ssl_params,mysql_servers_aws_rds_bgd_hostgroups,mysql_servers_runtime_checks,mysql_users,proxysql_servers,mysql_variables,admin_variables,ldap_variables,pgsql_query_rules,pgsql_servers,pgsql_users,pgsql_variables,mysql_ldap_mapping}; status={success,failure} |
proxysql_cluster_syn_conflict_total | counter | Number of times a ‘module’ has not been able to be synced. | module_name={mysql_query_rules,mysql_servers,proxysql_servers,mysql_users,mysql_variables,admin_variables,ldap_variables,pgsql_query_rules,pgsql_servers,pgsql_users,pgsql_variables}; reason={servers_share_epoch,version_one} |
proxysql_servers_checksums_changed_at | gauge | Time at which this configuration was loaded locally. | hostname; port; name |
proxysql_servers_checksums_diff_check | gauge | Number of checks in a row in which it was detected that remote conf is different than local one. | hostname; port; name |
proxysql_servers_checksums_epoch | gauge | Time at which this configuration was created (locally or imported). | hostname; port; name |
proxysql_servers_checksums_updated_at | gauge | Last time local ProxySQL checked the checksum of a remote instance. | hostname; port; name |
proxysql_servers_checksums_version_total | counter | Number of times the configuration has been loaded locally. | hostname; port; name |
proxysql_servers_metrics_client_conns_connected_total | gauge | Number of frontend client connections currently open on the Cluster node. | hostname; port |
proxysql_servers_metrics_client_conns_created_total | counter | Number of frontend client connections created over time on the Cluster node. | hostname; port |
proxysql_servers_metrics_last_check_ms | gauge | Latest time to process Cluster checks, in milliseconds | hostname; port |
proxysql_servers_metrics_queries_total | counter | Number of queries the Cluster node has processed. | hostname; port |
proxysql_servers_metrics_response_time_ms | gauge | Latest time to respond to Cluster checks, in milliseconds. | hostname; port |
proxysql_servers_metrics_uptime_s_total | counter | Current uptime of the Cluster node, in seconds. | hostname; port |
proxysql_servers_metrics_weight | gauge | Weight of the Cluster node, defined in the proxysql_servers table | Registered family; no released child-series producer |
Diagnostic messages
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_message_count_total | counter | Number of times a particular message has been logged by ProxySQL. | message_id; filename; line; func |
GenAI
| Exact family | Type | Meaning | Labels and values |
|---|---|---|---|
proxysql_genai_blocked_queries_total | counter | Number of queries the GenAI anomaly detector blocked (DENY returned to client). | None |
proxysql_genai_detected_anomalies_total | counter | Number of queries the GenAI anomaly detector flagged as anomalous (any risk). | None |
The dynamic connection-pool labels use endpoint=host:port and the numeric hostgroup. Error series use
backend address, port, numeric hostgroup, and error code. Cluster-node series use the node
hostname and port; checksum series also use the configuration-module name. The family marked without a
child-series producer, proxysql_servers_metrics_weight, is registered in the released source, but the same
source contains no active Add(...) path for it, so it does not produce samples. PostgreSQL thread metric
definitions are not in this released catalog because their registration is commented out.