Skip to main content

Prometheus Metrics

ProxySQL exposes application metrics via the /metrics endpoint in Prometheus exposition format. This page is a complete reference of all metrics available in ProxySQL v3.0, organized by functional area.

For setup and configuration of the Prometheus exporter, see Prometheus Exporter.

Metrics Categories

  1. Query Processing
  2. Connection Management
  3. Connection Pool (Per-Server)
  4. Error Tracking
  5. Backend Monitoring
  6. Query Cache
  7. Query Logging
  8. Server Status
  9. System & Memory
  10. Cluster
  11. Debug

Query Processing

Metrics tracking query execution: bytes transferred between frontends and backends, query processing time, query counts, and connection pool acquisition statistics.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_queries_backends_bytes_totalCounterBytes sent/received to backendsprotocol: mysql

traffic_flow: sent, received
proxysql_queries_frontends_bytes_totalCounterBytes sent/received from frontendsprotocol: mysql

traffic_flow: sent, received
proxysql_query_processor_time_seconds_totalCounterTime spent in query processorprotocol: mysql
proxysql_backend_query_time_seconds_totalCounterTime spent in backend network callsprotocol: mysql
proxysql_com_backend_stmt_totalCounterBackend prepared statement operationsprotocol: mysql

op: prepare, execute, close
proxysql_com_frontend_stmt_totalCounterFrontend prepared statement operationsprotocol: mysql

op: prepare, execute, close
proxysql_questions_totalCounterTotal client queries executedprotocol: mysql
proxysql_slow_queries_totalCounterQueries exceeding long_query_timeprotocol: mysql
proxysql_gtid_consistent_queries_totalCounterGTID consistent readsprotocol: mysql
proxysql_gtid_session_collected_totalCounterGTID session state queriesprotocol: mysql
proxysql_connpool_get_conn_success_latency_awareness_totalCounterLatency-aware connection picksprotocol: mysql
proxysql_connpool_get_conn_success_immediate_totalCounterPer-thread connection cache hitsprotocol: mysql
proxysql_connpool_get_conn_success_totalCounterSuccessful connection pool getsprotocol: mysql
proxysql_connpool_get_conn_failure_totalCounterFailed connection pool getsprotocol: mysql
proxysql_generated_error_packets_totalCounterError packets generated by ProxySQLprotocol: mysql
proxysql_max_connect_timeouts_totalCounterBackend connect timeoutsprotocol: mysql
proxysql_backend_lagging_during_query_totalCounterQueries failed due to server lagprotocol: mysql
proxysql_backend_offline_during_query_totalCounterQueries failed due to server offlineprotocol: mysql
proxysql_queries_with_max_lag_totalCounterQueries with max_lag attributeprotocol: mysql
proxysql_queries_with_max_lag__delayed_totalCounterQueries delayed by max_lagprotocol: mysql
proxysql_queries_with_max_lag__total_wait_time_totalCounterTotal wait time due to max_lag delaysprotocol: mysql
proxysql_mysql_unexpected_frontend_com_quit_totalCounterUnexpected COM_QUIT from clientsprotocol: mysql
proxysql_hostgroup_locked_set_cmds_totalCounterConnections locked into a hostgroupprotocol: mysql
proxysql_hostgroup_locked_queries_totalCounterQueries on hostgroup-locked connectionsprotocol: mysql
proxysql_mysql_unexpected_frontend_packets_totalCounterUnexpected packets from clientsprotocol: mysql
proxysql_aws_aurora_replicas_skipped_during_query_totalCounterAurora replicas skipped due to lagprotocol: mysql
proxysql_automatic_detected_sql_injection_totalCounterSQL injection attempts blockedprotocol: mysql
proxysql_mysql_whitelisted_sqli_fingerprint_totalCounterWhitelisted SQL injection fingerprintsprotocol: mysql
proxysql_mysql_killed_backend_connections_totalCounterKilled backend connectionsprotocol: mysql
proxysql_mysql_killed_backend_queries_totalCounterKilled backend queriesprotocol: mysql
proxysql_client_host_error_killed_connectionsCounterConnections killed by host error limitprotocol: mysql
proxysql_mysql_unexpected_frontend_com_ping_totalCounterUnexpected COM_PING from clients
proxysql_ai_detected_anomalies_totalCounterAI-detected query anomaliesprotocol: mysql
proxysql_ai_blocked_queries_totalCounterQueries blocked by AI detectionprotocol: mysql
proxysql_mysql_set_wait_timeout_commands_totalCounterSET wait_timeout commands received
proxysql_mysql_timeout_terminated_connections_totalCounterConnections terminated by wait_timeout

Connection Management

Metrics for connection lifecycle events: creation, authentication, transaction commands, and protocol-specific connection operations such as SET NAMES, INIT DB, and SET client_encoding.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_servers_table_version_totalCounterServer table version changes
proxysql_server_connections_totalCounterServer connections by statusprotocol: mysql, pgsql

status: created, delayed, aborted
proxysql_client_connections_totalCounterClient connections by statusprotocol: mysql, pgsql

status: created, aborted
proxysql_client_connections_sha2cached_totalCounterSHA2 cached password authentication attempts
proxysql_com_autocommit_totalCounterAutocommitted queries
proxysql_com_autocommit_filtered_totalCounterFiltered autocommit commands
proxysql_com_rollback_totalCounterTransaction rollbacks
proxysql_com_rollback_filtered_totalCounterFiltered rollback commands
proxysql_com_backend_change_user_totalCounterBackend COM_CHANGE_USER commands
proxysql_com_backend_init_db_totalCounterBackend INIT DB commands
proxysql_com_backend_set_names_totalCounterBackend SET NAMES commands
proxysql_com_frontend_init_db_totalCounterFrontend INIT DB commands
proxysql_com_frontend_set_names_totalCounterFrontend SET NAMES commands
proxysql_com_frontend_use_db_totalCounterFrontend USE DB commands
proxysql_com_backend_reset_connection_totalCounterBackend reset connection commands
proxysql_com_backend_set_client_encoding_totalCounterBackend SET client_encoding commands
proxysql_com_frontend_set_client_encoding_totalCounterFrontend SET client_encoding commands
proxysql_com_commit_cnt_totalCounterTransaction commits
proxysql_com_commit_cnt_filtered_totalCounterFiltered commit commands
proxysql_selects_for_update__autocommit0_totalCounterSELECT FOR UPDATE with autocommit off
proxysql_myhgm_myconnpool_get_totalCounterMySQL connection pool requests
proxysql_myhgm_myconnpool_get_ok_totalCounterMySQL connection pool successes
proxysql_myhgm_myconnpool_get_ping_totalCounterMySQL connection pool ping keep-alives
proxysql_myhgm_myconnpool_push_totalCounterMySQL connection pool returns
proxysql_myhgm_myconnpool_reset_totalCounterMySQL connection pool resets
proxysql_myhgm_myconnpool_destroy_totalCounterMySQL connection pool destroys
proxysql_myhgm_auto_increment_multiplex_totalCounterAuto-increment multiplex triggers
proxysql_pghgm_pgconnpool_get_totalCounterPostgreSQL connection pool requests
proxysql_pghgm_pgconnpool_get_ok_totalCounterPostgreSQL connection pool successes
proxysql_pghgm_myconnpool_get_ping_totalCounterPostgreSQL connection pool ping keep-alives
proxysql_pghgm_pgconnpool_push_totalCounterPostgreSQL connection pool returns
proxysql_pghgm_pgconnpool_reset_totalCounterPostgreSQL connection pool resets
proxysql_pghgm_pgconnpool_destroy_totalCounterPostgreSQL connection pool destroys

Connection Pool (Per-Server)

Per-backend server metrics with dynamic labels for hostgroup and endpoint. The number of time series scales with the number of configured backend servers.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_connpool_data_bytes_totalCounterBytes sent/received to backend servershostgroup, endpoint

traffic_flow: sent, recv
proxysql_connpool_conns_totalCounterConnection attempts to backend servershostgroup, endpoint

status: ok, err
proxysql_connpool_conns_queries_totalCounterQueries routed to backend servershostgroup, endpoint
proxysql_gtid_executed_totalCounterGTID executions per backend serverhostgroup, endpoint
proxysql_connpool_connsGaugeBackend connections by statushostgroup, endpoint

status: free, used
proxysql_connpool_conns_latency_usGaugeBackend server ping latency (microseconds)hostgroup, endpoint
proxysql_connpool_conns_statusGaugeBackend server status (1=ONLINE, 2=SHUNNED, 3=OFFLINE_SOFT, 4=OFFLINE_HARD, 5=SHUNNED_REPL_LAG)hostgroup, endpoint

Error Tracking

Error counters for authentication denials and backend/proxy-generated errors. Error metrics use dynamic labels and can produce a large number of time series.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_access_denied_wrong_password_totalCounterWrong password denialsprotocol: mysql, pgsql
proxysql_access_denied_max_connections_totalCounterMax connections denialsprotocol: mysql, pgsql
proxysql_access_denied_max_user_connections_totalCounterMax user connections denialsprotocol: mysql, pgsql
proxysql_mysql_error_totalCounterMySQL errors generated by ProxySQLhostgroup, endpoint, errno
mysql_error_totalCounterMySQL errors from backendshostgroup, endpoint, errno
proxysql_pgsql_error_totalCounterPostgreSQL errors generated by ProxySQLhostgroup, endpoint, errno
pgsql_error_totalCounterPostgreSQL errors from backendshostgroup, endpoint, errno

Backend Monitoring

Health check metrics from ProxySQL's MySQL backend monitoring system: connect checks, ping checks, read-only checks, replication lag checks, and DNS cache statistics.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_mysql_monitor_workers_started_totalCounterMonitor worker threads started
proxysql_mysql_monitor_connect_check_totalCounterBackend connect checksstatus: ok, err
proxysql_mysql_monitor_ping_check_totalCounterBackend ping checksstatus: ok, err
proxysql_mysql_monitor_read_only_check_totalCounterBackend read-only checksstatus: ok, err
proxysql_mysql_monitor_replication_lag_check_totalCounterBackend replication lag checksstatus: ok, err
proxysql_mysql_monitor_dns_cache_queriedCounterDNS cache queries
proxysql_mysql_monitor_dns_cache_lookup_successCounterDNS cache successful lookups
proxysql_mysql_monitor_dns_cache_record_updatedCounterDNS cache records updated
proxysql_mysql_monitor_workersGaugeCurrent monitor worker threads
proxysql_mysql_monitor_workers_auxGaugeCurrent auxiliary monitor threads

Query Cache

ProxySQL's built-in query cache metrics: cache hit/miss rates, byte throughput, entry counts, and memory usage.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_query_cache_count_get_totalCounterCache read requestsprotocol: mysql, pgsql

status: ok, err
proxysql_query_cache_count_set_totalCounterCache write requestsprotocol: mysql, pgsql
proxysql_query_cache_bytes_totalCounterCache bytes read/writtenprotocol: mysql, pgsql

op: read, written
proxysql_query_cache_purged_totalCounterCache entries purged by TTLprotocol: mysql, pgsql
proxysql_query_cache_entries_totalCounterCurrent number of cache entriesprotocol: mysql, pgsql
proxysql_query_cache_memory_bytesGaugeCurrent cache memory usageprotocol: mysql, pgsql

Query Logging

Metrics from ProxySQL's query logging subsystem: event copying to memory and disk, event retrieval, circular buffer status, and total logged queries.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_mysql_logger_copy_totalCounterMySQL logger copy operationstarget: memory, disk
proxysql_mysql_logger_get_all_events_calls_totalCounterMySQL logger get_all_events calls
proxysql_mysql_logger_get_all_events_events_totalCounterMySQL logger events retrieved
proxysql_mysql_logger_copy_seconds_totalCounterMySQL logger copy durationtarget: memory, disk
proxysql_mysql_logger_get_all_events_seconds_totalCounterMySQL logger get_all_events duration
proxysql_mysql_logger_events_copied_totalCounterMySQL logger events copiedtarget: memory, disk
proxysql_mysql_logger_circular_buffer_events_totalCounterMySQL logger buffer eventstype: added, dropped
proxysql_mysql_logger_circular_buffer_eventsGaugeMySQL logger current buffer size
proxysql_pgsql_logger_copy_totalCounterPostgreSQL logger copy operationstarget: memory, disk
proxysql_pgsql_logger_get_all_events_calls_totalCounterPostgreSQL logger get_all_events calls
proxysql_pgsql_logger_get_all_events_events_totalCounterPostgreSQL logger events retrieved
proxysql_pgsql_logger_copy_seconds_totalCounterPostgreSQL logger copy durationtarget: memory, disk
proxysql_pgsql_logger_get_all_events_seconds_totalCounterPostgreSQL logger get_all_events duration
proxysql_pgsql_logger_events_copied_totalCounterPostgreSQL logger events copiedtarget: memory, disk
proxysql_pgsql_logger_circular_buffer_events_totalCounterPostgreSQL logger buffer eventstype: added, dropped
proxysql_pgsql_logger_circular_buffer_eventsGaugePostgreSQL logger current buffer size
proxysql_query_logger_logged_queries_totalCounterTotal queries accepted by query loggersprotocol: mysql, pgsql

Server Status

Point-in-time gauges for active transactions, connection states, buffer memory, query mirroring, thread worker counts, monitor configuration, and current connected clients and servers.

MetricTypeDescriptionMySQLPostgreSQLLabels
proxysql_active_transactionsGaugeCurrent transactions in progressprotocol: mysql
proxysql_client_connections_non_idleGaugeNon-idle client connectionsprotocol: mysql
proxysql_client_connections_hostgroup_lockedGaugeHostgroup-locked connectionsprotocol: mysql
proxysql_mysql_backend_buffers_bytesGaugeBackend fast_forward buffer memory
proxysql_mysql_frontend_buffers_bytesGaugeFrontend buffer memory
proxysql_mysql_session_internal_bytesGaugeSession internal memory
proxysql_mirror_concurrencyGaugeActive mirror sessionsprotocol: mysql
proxysql_mirror_queue_lengthsGaugeQueued mirror sessionsprotocol: mysql
proxysql_mysql_thread_workersGaugeMySQL thread worker count
proxysql_mysql_wait_timeoutGaugeSession idle timeout (seconds)
proxysql_mysql_max_connectionsGaugeMaximum client connections
proxysql_mysql_monitor_enabledGaugeMonitor enabled (1=yes, 0=no)
proxysql_mysql_monitor_ping_intervalGaugeMonitor ping interval (ms)
proxysql_mysql_monitor_ping_timeout_secondsGaugeMonitor ping timeout
proxysql_mysql_monitor_ping_max_failuresGaugeMonitor ping max failures before shunning
proxysql_mysql_monitor_aws_rds_topology_discovery_intervalGaugeAWS RDS topology discovery interval (ms)
proxysql_mysql_monitor_read_only_interval_secondsGaugeMonitor read-only check interval
proxysql_mysql_monitor_read_only_timeout_secondsGaugeMonitor read-only check timeout
proxysql_mysql_monitor_writer_is_also_readerGaugeWriter-is-also-reader mode
proxysql_monitor_replication_lag_group_by_hostGaugeReplication lag group-by-host mode
proxysql_mysql_monitor_replication_lag_interval_secondsGaugeReplication lag check interval
proxysql_mysql_monitor_replication_lag_timeout_secondsGaugeReplication lag check timeout
proxysql_mysql_monitor_history_timeout_secondsGaugeMonitor event history retention
proxysql_server_connections_connectedGaugeCurrent backend connectionsprotocol: mysql, pgsql
proxysql_client_connections_connectedGaugeCurrent client connectionsprotocol: mysql, pgsql
proxysql_client_connections_connected_primaryGaugeConnections using primary password
proxysql_client_connections_connected_additionalGaugeConnections using additional password

System & Memory

ProxySQL process-level metrics: uptime, memory allocators, prepared statement caches, firewall memory, stack sizes, file descriptors, and version information. These metrics are protocol-independent.

MetricTypeDescriptionLabels
proxysql_uptime_seconds_totalCounterProxySQL uptime in seconds
proxysql_jemalloc_allocated_bytes_totalCounterBytes allocated by the application
proxysql_mysql_listener_pausedGaugeMySQL listener paused (1=paused, 0=active)
proxysql_pgsql_listener_pausedGaugePostgreSQL listener paused (1=paused, 0=active)
proxysql_connpool_memory_bytesGaugeConnection pool metadata memory
proxysql_sqlite3_memory_bytesGaugeSQLite memory usage
proxysql_jemalloc_bytesGaugeJemalloc memory statisticstype: resident, active, mapped, metadata, retained
proxysql_query_digest_memory_bytesGaugeQuery digest memory
proxysql_auth_memory_bytesGaugeAuthentication module memory
proxysql_mysql_query_rules_memory_bytesGaugeQuery rules memory
proxysql_mysql_firewall_users_table_bytesGaugeFirewall users table memory
proxysql_mysql_firewall_users_config_bytesGaugeFirewall users config memory
proxysql_mysql_firewall_rules_table_bytesGaugeFirewall rules table memory
proxysql_mysql_firewall_rules_config_bytesGaugeFirewall rules config memory
proxysql_stack_memory_mysql_threads_bytesGaugeMySQL thread stack memory
proxysql_stack_memory_admin_threads_bytesGaugeAdmin thread stack memory
proxysql_stack_memory_cluster_threadsGaugeCluster thread stack memory
proxysql_stmt_client_activeGaugeActive client prepared statements
proxysql_stmt_client_active_uniqueGaugeUnique active client prepared statements
proxysql_stmt_server_activeGaugeActive server prepared statements
proxysql_stmt_server_active_uniqueGaugeUnique active server prepared statements
proxysql_stmt_max_stmt_idGaugeMaximum statement ID ever used
proxysql_stmt_cachedGaugeCached global prepared statements with metadata
prepare_stmt_metadata_memory_bytesGaugePrepared statement metadata memory
prepare_stmt_backend_memory_bytesGaugePrepared statement backend memory
proxysql_fds_in_useGaugeFile descriptors in use
proxysql_version_infoGaugeProxySQL version information (always 1)version, version_comment

Cluster

ProxySQL Cluster synchronization metrics: configuration pulls from peers, sync conflicts, node checksums, and peer health statistics. Labels include hostname and port for per-node metrics.

MetricTypeDescriptionLabels
proxysql_cluster_pulled_totalCounterConfiguration pulls from cluster peersmodule_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_runtime_checks, mysql_users, proxysql_servers, mysql_variables, admin_variables, ldap_variables, mysql_ldap_mapping

status: success, failure
proxysql_cluster_syn_conflict_totalCounterCluster synchronization conflictsmodule_name: mysql_query_rules, mysql_servers, mysql_users, proxysql_servers, mysql_variables, admin_variables, ldap_variables

reason: servers_share_epoch, version_one
proxysql_servers_checksums_version_totalCounterConfiguration load count per nodehostname, port, name
proxysql_servers_metrics_uptime_s_totalCounterCluster node uptimehostname, port
proxysql_servers_metrics_queries_totalCounterQueries processed by cluster nodehostname, port
proxysql_servers_metrics_client_conns_created_totalCounterClient connections created on cluster nodehostname, port
proxysql_servers_clients_status_last_seen_atGaugeLast time a cluster node was seenhostname, port
proxysql_servers_checksums_epochGaugeConfiguration creation timestamphostname, port, name
proxysql_servers_checksums_changed_atGaugeConfiguration load timestamphostname, port, name
proxysql_servers_checksums_updated_atGaugeLast checksum verification timestamphostname, port, name
proxysql_servers_checksums_diff_checkGaugeConsecutive checksum diff detectionshostname, port, name
proxysql_servers_metrics_weightGaugeCluster node weighthostname, port
proxysql_servers_metrics_response_time_msGaugeCluster check response time (ms)hostname, port
proxysql_servers_metrics_last_check_msGaugeCluster check processing time (ms)hostname, port
proxysql_servers_metrics_client_conns_connected_totalGaugeCurrent frontend connections on cluster nodehostname, port

Debug

Internal debug message counters. A new time series is created for each unique combination of message ID, source file, line number, and function name.

MetricTypeDescriptionLabels
proxysql_message_count_totalCounterNumber of times a debug message has been loggedmessage_id, filename, line, func