From a69b925932502b8ac9d47e2a983e4723ae207922 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Thu, 12 Feb 2026 19:39:01 +0000 Subject: [PATCH] Minor typo fixes --- doc/PROMETHEUS_PROTOCOL_LABELS.md | 2 +- lib/PgSQL_Thread.cpp | 110 +----------------------------- 2 files changed, 4 insertions(+), 108 deletions(-) diff --git a/doc/PROMETHEUS_PROTOCOL_LABELS.md b/doc/PROMETHEUS_PROTOCOL_LABELS.md index 2fd200346..eed740d7c 100644 --- a/doc/PROMETHEUS_PROTOCOL_LABELS.md +++ b/doc/PROMETHEUS_PROTOCOL_LABELS.md @@ -46,7 +46,7 @@ This follows prometheus best practices where metrics that represent different en | File | Lines Changed | Description | |------|--------------|-------------| -| `lib/MySQL_HostGroups_Manager.cpp` | +25/-10 | Added `protocol="mysql"` labels to PgHGM metrics | +| `lib/MySQL_HostGroups_Manager.cpp` | +25/-10 | Added `protocol="mysql"` labels to MyHGM metrics | | `lib/MySQL_Thread.cpp` | +340/-71 | Added `protocol="mysql"` labels to 65 MTH metrics | | `lib/PgSQL_HostGroups_Manager.cpp` | +25/-10 | Added `protocol="pgsql"` labels to PgHGM metrics | | `lib/PgSQL_Thread.cpp` | +310/-42 | Added `protocol="pgsql"` labels to 60 PTH metrics | diff --git a/lib/PgSQL_Thread.cpp b/lib/PgSQL_Thread.cpp index 66e4ac95b..258b75c35 100644 --- a/lib/PgSQL_Thread.cpp +++ b/lib/PgSQL_Thread.cpp @@ -528,21 +528,13 @@ th_metrics_map = std::make_tuple( p_th_counter::query_processor_time_nsec, "proxysql_query_processor_time_seconds_total", "The time spent inside the \"Query Processor\" to determine what action needs to be taken with the query (internal module).", - metric_tags { - - { "protocol", "pgsql" } - - } + metric_tags { { "protocol", "pgsql" } } ), std::make_tuple( p_th_counter::backend_query_time_nsec, "proxysql_backend_query_time_seconds_total", "Time spent making network calls to communicate with the backends.", - metric_tags { - - { "protocol", "pgsql" } - - } + metric_tags { { "protocol", "pgsql" } } ), // ==================================================================== @@ -610,19 +602,15 @@ th_metrics_map = std::make_tuple( "proxysql_questions_total", "The total number of client requests / statements executed.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( p_th_counter::slow_queries, "proxysql_slow_queries_total", - "The total number of queries with an execution time greater than \"mysql-long_query_time\" milliseconds.", + "The total number of queries with an execution time greater than \"pgsql-long_query_time\" milliseconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -630,9 +618,7 @@ th_metrics_map = std::make_tuple( "proxysql_gtid_consistent_queries_total", "Total queries with GTID consistent read.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -640,9 +626,7 @@ th_metrics_map = std::make_tuple( "proxysql_gtid_session_collected_total", "Total queries with GTID session state.", metric_tags { - { "protocol", "pgsql" } - } ), @@ -652,9 +636,7 @@ th_metrics_map = std::make_tuple( "proxysql_connpool_get_conn_success_latency_awareness_total", "The connection was picked using the latency awareness algorithm.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -662,9 +644,7 @@ th_metrics_map = std::make_tuple( "proxysql_connpool_get_conn_success_immediate_total", "The connection is provided from per-thread cache.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -672,9 +652,7 @@ th_metrics_map = std::make_tuple( "proxysql_connpool_get_conn_success_total", "The session is able to get a connection, either from per-thread cache or connection pool.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -682,9 +660,7 @@ th_metrics_map = std::make_tuple( "proxysql_connpool_get_conn_failure_total", "The connection pool cannot provide any connection.", metric_tags { - { "protocol", "pgsql" } - } ), // ==================================================================== @@ -694,9 +670,7 @@ th_metrics_map = std::make_tuple( "proxysql_generated_error_packets_total", "Total generated error packets.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -704,9 +678,7 @@ th_metrics_map = std::make_tuple( "proxysql_max_connect_timeouts_total", "Maximum connection timeout reached when trying to connect to backend sever.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -714,9 +686,7 @@ th_metrics_map = std::make_tuple( "proxysql_backend_lagging_during_query_total", "Query failed because server was shunned due to lag.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -724,9 +694,7 @@ th_metrics_map = std::make_tuple( "proxysql_backend_offline_during_query_total", "Query failed because server was offline.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -734,9 +702,7 @@ th_metrics_map = std::make_tuple( "proxysql_queries_with_max_lag_total", "Received queries that have a 'max_lag' attribute.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -744,9 +710,7 @@ th_metrics_map = std::make_tuple( "proxysql_queries_with_max_lag__delayed_total", "Query delayed because no connection was selected due to 'max_lag' annotation.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -754,9 +718,7 @@ th_metrics_map = std::make_tuple( "proxysql_queries_with_max_lag__total_wait_time_total", "Total waited time due to connection selection because of 'max_lag' annotation.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -764,9 +726,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_unexpected_frontend_com_quit_total", "Unexpected 'COM_QUIT' received from the client.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -774,9 +734,7 @@ th_metrics_map = std::make_tuple( "proxysql_hostgroup_locked_set_cmds_total", "Total number of connections that have been locked in a hostgroup.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -784,9 +742,7 @@ th_metrics_map = std::make_tuple( "proxysql_hostgroup_locked_queries_total", "Query blocked because connection is locked into some hostgroup but is trying to reach other.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -794,9 +750,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_unexpected_frontend_packets_total", "Unexpected packet received from client.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -804,9 +758,7 @@ th_metrics_map = std::make_tuple( "proxysql_aws_aurora_replicas_skipped_during_query_total", "Replicas skipped due to current lag being higher than 'max_lag' annotation.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -814,9 +766,7 @@ th_metrics_map = std::make_tuple( "proxysql_automatic_detected_sql_injection_total", "Blocked a detected 'sql injection' attempt.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -824,9 +774,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_whitelisted_sqli_fingerprint_total", "Detected a whitelisted 'sql injection' fingerprint.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -834,9 +782,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_killed_backend_connections_total", "Number of backend connection killed.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -844,9 +790,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_killed_backend_queries_total", "Killed backend queries.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -854,9 +798,7 @@ th_metrics_map = std::make_tuple( "proxysql_client_host_error_killed_connections", "Killed client connections because address exceeded 'client_host_error_counts'.", metric_tags { - { "protocol", "pgsql" } - } ) }, @@ -866,9 +808,7 @@ th_metrics_map = std::make_tuple( "proxysql_active_transactions", "Provides a count of how many client connection are currently processing a transaction.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -876,9 +816,7 @@ th_metrics_map = std::make_tuple( "proxysql_client_connections_non_idle", "Number of client connections that are currently handled by the main worker threads.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -886,9 +824,7 @@ th_metrics_map = std::make_tuple( "proxysql_client_connections_hostgroup_locked", "Number of client connection locked to a specific hostgroup.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -896,9 +832,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_backend_buffers_bytes", "Buffers related to backend connections if \"fast_forward\" is used (0 means fast_forward is not used).", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -906,9 +840,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_frontend_buffers_bytes", "Buffers related to frontend connections (read/write buffers and other queues).", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -916,9 +848,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_session_internal_bytes", "Other memory used by ProxySQL to handle MySQL Sessions.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -926,9 +856,7 @@ th_metrics_map = std::make_tuple( "proxysql_mirror_concurrency", "Mirror current concurrency", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -936,9 +864,7 @@ th_metrics_map = std::make_tuple( "proxysql_mirror_queue_lengths", "Mirror queue length", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -946,9 +872,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_thread_workers", "Number of MySQL Thread workers i.e. 'mysql-threads'", metric_tags { - { "protocol", "pgsql" } - } ), // global_variables @@ -957,9 +881,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_wait_timeout", "If a proxy session has been idle for more than this threshold, the proxy will kill the session.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -967,9 +889,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_max_connections", "The maximum number of client connections that the proxy can handle.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -977,9 +897,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_enabled", "Enables or disables MySQL Monitor.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -987,9 +905,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_ping_interval", "How frequently a ping check is performed, in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -997,9 +913,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_ping_timeout_seconds", "Ping timeout in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1007,9 +921,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_ping_max_failures", "Reached maximum ping attempts from monitor.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple ( @@ -1017,9 +929,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_aws_rds_topology_discovery_interval", "How frequently a topology discovery is performed, e.g. a value of 500 means one topology discovery every 500 read-only checks ", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1027,9 +937,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_read_only_interval_seconds", "How frequently a read only check is performed, in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1037,9 +945,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_read_only_timeout_seconds", "Read only check timeout in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1047,9 +953,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_writer_is_also_reader", "Encodes different behaviors for nodes depending on their 'READ_ONLY' flag value.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1057,9 +961,7 @@ th_metrics_map = std::make_tuple( "proxysql_monitor_replication_lag_group_by_host", "Encodes different replication lag check if the same server is in multiple hostgroups.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1067,9 +969,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_replication_lag_interval_seconds", "How frequently a replication lag check is performed, in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1077,9 +977,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_replication_lag_timeout_seconds", "Replication lag check timeout in seconds.", metric_tags { - { "protocol", "pgsql" } - } ), std::make_tuple( @@ -1087,9 +985,7 @@ th_metrics_map = std::make_tuple( "proxysql_mysql_monitor_history_timeout_seconds", "The duration for which the events for the checks made by the Monitor module are kept, in seconds.", metric_tags { - { "protocol", "pgsql" } - } ) }