From f6e0e64f42f7694bcb46f43f9ea2c484e9af84c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Sun, 11 Oct 2020 05:42:02 +0200 Subject: [PATCH] "Changed prometheus counter naming convention to include '_total' suffix" - Other metrics names has also be changed due to this global change. --- lib/MySQL_HostGroups_Manager.cpp | 84 ++++++++++++++++---------------- lib/MySQL_Monitor.cpp | 18 +++---- lib/MySQL_Thread.cpp | 74 ++++++++++++++-------------- lib/ProxySQL_Admin.cpp | 4 +- lib/ProxySQL_Cluster.cpp | 52 ++++++++++---------- lib/Query_Cache.cpp | 14 +++--- 6 files changed, 123 insertions(+), 123 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index cac213cbc..c14f25de2 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -1015,7 +1015,7 @@ hg_metrics_map = std::make_tuple( hg_counter_vector { std::make_tuple ( p_hg_counter::servers_table_version, - "proxysql_servers_table_version", + "proxysql_servers_table_version_total", "Number of times the \"servers_table\" have been modified.", metric_tags {} ), @@ -1023,7 +1023,7 @@ hg_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_hg_counter::server_connections_created, - "proxysql_server_connections", + "proxysql_server_connections_total", "Total number of server connections (created|delayed|aborted).", metric_tags { { "status", "created" } @@ -1031,7 +1031,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_counter::server_connections_delayed, - "proxysql_server_connections", + "proxysql_server_connections_total", "Total number of server connections (created|delayed|aborted).", metric_tags { { "status", "delayed" } @@ -1039,7 +1039,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_counter::server_connections_aborted, - "proxysql_server_connections", + "proxysql_server_connections_total", "Total number of server connections (created|delayed|aborted).", metric_tags { { "status", "aborted" } @@ -1050,7 +1050,7 @@ hg_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_hg_counter::client_connections_created, - "proxysql_client_connections", + "proxysql_client_connections_total", "Total number of client connections created.", metric_tags { { "status", "created" } @@ -1058,7 +1058,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_counter::client_connections_aborted, - "proxysql_client_connections", + "proxysql_client_connections_total", "Total number of client failed connections (or closed improperly).", metric_tags { { "status", "aborted" } @@ -1068,97 +1068,97 @@ hg_metrics_map = std::make_tuple( std::make_tuple ( p_hg_counter::com_autocommit, - "proxysql_com_autocommit", + "proxysql_com_autocommit_total", "Total queries autocommited.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_autocommit_filtered, - "proxysql_com_autocommit_filtered", + "proxysql_com_autocommit_filtered_total", "Total queries filtered autocommit.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_rollback, - "proxysql_com_rollback", + "proxysql_com_rollback_total", "Total queries rollbacked.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_rollback_filtered, - "proxysql_com_rollback_filtered", + "proxysql_com_rollback_filtered_total", "Total queries filtered rollbacked.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_backend_change_user, - "proxysql_com_backend_change_user", + "proxysql_com_backend_change_user_total", "Total CHANGE_USER queries backend.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_backend_init_db, - "proxysql_com_backend_init_db", + "proxysql_com_backend_init_db_total", "Total queries backend INIT DB.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_backend_set_names, - "proxysql_com_backend_set_names", + "proxysql_com_backend_set_names_total", "Total queries backend SET NAMES.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_frontend_init_db, - "proxysql_com_frontend_init_db", + "proxysql_com_frontend_init_db_total", "Total INIT DB queries frontend.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_frontend_set_names, - "proxysql_com_frontend_set_names", + "proxysql_com_frontend_set_names_total", "Total SET NAMES frontend queries.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_frontend_use_db, - "proxysql_com_frontend_use_db", + "proxysql_com_frontend_use_db_total", "Total USE DB queries frontend.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_commit_cnt, - "proxysql_com_commit_cnt", + "proxysql_com_commit_cnt_total", "Total queries commit.", metric_tags {} ), std::make_tuple ( p_hg_counter::com_commit_cnt_filtered, - "proxysql_com_commit_cnt_filtered", + "proxysql_com_commit_cnt_filtered_total", "Total queries commit filtered.", metric_tags {} ), std::make_tuple ( p_hg_counter::selects_for_update__autocommit0, - "proxysql_selects_for_update__autocommit0", + "proxysql_selects_for_update__autocommit0_total", "Total queries that are SELECT for update or equivalent.", metric_tags {} ), std::make_tuple ( p_hg_counter::access_denied_wrong_password, - "proxysql_access_denied_wrong_password", + "proxysql_access_denied_wrong_password_total", "Total access denied \"wrong password\".", metric_tags {} ), std::make_tuple ( p_hg_counter::access_denied_max_connections, - "proxysql_access_denied_max_connections", + "proxysql_access_denied_max_connections_total", "Total access denied \"max connections\".", metric_tags {} ), std::make_tuple ( p_hg_counter::access_denied_max_user_connections, - "proxysql_access_denied_max_user_connections", + "proxysql_access_denied_max_user_connections_total", "Total access denied \"max user connections\".", metric_tags {} ), @@ -1166,13 +1166,13 @@ hg_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_hg_counter::myhgm_myconnpool_get, - "proxysql_myhgm_myconnpool_get", + "proxysql_myhgm_myconnpool_get_total", "The number of requests made to the connection pool.", metric_tags {} ), std::make_tuple ( p_hg_counter::myhgm_myconnpool_get_ok, - "proxysql_myhgm_myconnpool_get", + "proxysql_myhgm_myconnpool_get_total", "The number of successful requests to the connection pool (i.e. where a connection was available).", metric_tags { { "status", "ok" } @@ -1180,7 +1180,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_counter::myhgm_myconnpool_get_ping, - "proxysql_myhgm_myconnpool_get", + "proxysql_myhgm_myconnpool_get_total", "The number of connections that were taken from the pool to run a ping to keep them alive.", metric_tags { { "purpose", "ping" } @@ -1190,19 +1190,19 @@ hg_metrics_map = std::make_tuple( std::make_tuple ( p_hg_counter::myhgm_myconnpool_push, - "proxysql_myhgm_myconnpool_push", + "proxysql_myhgm_myconnpool_push_total", "The number of connections returned to the connection pool.", metric_tags {} ), std::make_tuple ( p_hg_counter::myhgm_myconnpool_reset, - "proxysql_myhgm_myconnpool_reset", + "proxysql_myhgm_myconnpool_reset_total", "The number of connections that have been reset / re-initialized using \"COM_CHANGE_USER\"", metric_tags {} ), std::make_tuple ( p_hg_counter::myhgm_myconnpool_destroy, - "proxysql_myhgm_myconnpool_destroy", + "proxysql_myhgm_myconnpool_destroy_total", "The number of connections considered unhealthy and therefore closed.", metric_tags {} ) @@ -1230,7 +1230,7 @@ hg_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_hg_dyn_counter::conn_pool_bytes_data_recv, - "proxysql_connection_pool_data_bytes", + "proxysql_connpool_data_bytes_total", "Amount of data (sent|recv) from the backend, excluding metadata.", metric_tags { { "traffic_flow", "recv" } @@ -1238,7 +1238,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_dyn_counter::conn_pool_bytes_data_sent, - "proxysql_connection_pool_data_bytes", + "proxysql_connpool_data_bytes_total", "Amount of data (sent|recv) from the backend, excluding metadata.", metric_tags { { "traffic_flow", "sent" } @@ -1249,7 +1249,7 @@ hg_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_hg_dyn_counter::connection_pool_conn_err, - "proxysql_connection_pool_conn_est", + "proxysql_connpool_conns_total", "How many connections have been tried to be established.", metric_tags { { "status", "err" } @@ -1257,7 +1257,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_dyn_counter::connection_pool_conn_ok, - "proxysql_connection_pool_conn_est", + "proxysql_connpool_conns_total", "How many connections have been tried to be established.", metric_tags { { "status", "ok" } @@ -1267,28 +1267,28 @@ hg_metrics_map = std::make_tuple( std::make_tuple ( p_hg_dyn_counter::connection_pool_queries, - "proxysql_connection_pool_conn_queries", + "proxysql_connpool_conns_queries_total", "The number of queries routed towards this particular backend server.", metric_tags {} ), // gtid std::make_tuple ( p_hg_dyn_counter::gtid_executed, - "proxysql_gtid_executed", + "proxysql_gtid_executed_total", "Tracks the number of executed gtid per host and port.", metric_tags {} ), // mysql_error std::make_tuple ( p_hg_dyn_counter::proxysql_mysql_error, - "proxysql_mysql_error", - "Tracks the mysql errors generated by proxysql, identifying them by: hostgroup + hostname + port + error_code.", + "proxysql_mysql_error_total", + "Tracks the mysql errors generated by proxysql.", metric_tags {} ), std::make_tuple ( p_hg_dyn_counter::mysql_error, - "mysql_error", - "Tracks the mysql errors encountered, identifying them by: hostgroup + hostname + port + error_code.", + "mysql_error_total", + "Tracks the mysql errors encountered.", metric_tags {} ) }, @@ -1296,7 +1296,7 @@ hg_metrics_map = std::make_tuple( hg_dyn_gauge_vector { std::make_tuple ( p_hg_dyn_gauge::connection_pool_conn_free, - "proxysql_connection_pool_conn_av", + "proxysql_connpool_conns", "How many backend connections are currently (free|used).", metric_tags { { "status", "free" } @@ -1304,7 +1304,7 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_dyn_gauge::connection_pool_conn_used, - "proxysql_connection_pool_conn_av", + "proxysql_connpool_conns", "How many backend connections are currently (free|used).", metric_tags { { "status", "used" } @@ -1312,13 +1312,13 @@ hg_metrics_map = std::make_tuple( ), std::make_tuple ( p_hg_dyn_gauge::connection_pool_latency_us, - "proxysql_connection_pool_conn_latency_us", + "proxysql_connpool_conns_latency_us", "The currently ping time in microseconds, as reported from Monitor.", metric_tags {} ), std::make_tuple ( p_hg_dyn_gauge::connection_pool_status, - "proxysql_connection_pool_conn_status", + "proxysql_connpool_conns_status", "The status of the backend server (1 - ONLINE, 2 - SHUNNED, 3 - OFFLINE_SOFT, 4 - OFFLINE_HARD).", metric_tags {} ) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 5b4405ee6..269e30339 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -573,7 +573,7 @@ mon_metrics_map = std::make_tuple( mon_counter_vector { std::make_tuple ( p_mon_counter::mysql_monitor_workers_started, - "proxysql_mysql_monitor_workers_started", + "proxysql_mysql_monitor_workers_started_total", "Number of MySQL Monitor workers started.", metric_tags {} ), @@ -581,7 +581,7 @@ mon_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_mon_counter::mysql_monitor_connect_check_ok, - "proxysql_mysql_monitor_connect_check", + "proxysql_mysql_monitor_connect_check_total", "Number of (succeed|failed) 'connect checks' from 'monitor_connect_thread'.", metric_tags { { "status", "ok" } @@ -589,7 +589,7 @@ mon_metrics_map = std::make_tuple( ), std::make_tuple ( p_mon_counter::mysql_monitor_connect_check_err, - "proxysql_mysql_monitor_connect_check", + "proxysql_mysql_monitor_connect_check_total", "Number of (succeed|failed) 'connect checks' from 'monitor_connect_thread'.", metric_tags { { "status", "err" } @@ -600,7 +600,7 @@ mon_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_mon_counter::mysql_monitor_ping_check_ok, - "proxysql_mysql_monitor_ping_check", + "proxysql_mysql_monitor_ping_check_total", "Number of (succeed|failed) 'ping checks' from 'monitor_ping_thread'.", metric_tags { { "status", "ok" } @@ -608,7 +608,7 @@ mon_metrics_map = std::make_tuple( ), std::make_tuple ( p_mon_counter::mysql_monitor_ping_check_err, - "proxysql_mysql_monitor_ping_check", + "proxysql_mysql_monitor_ping_check_total", "Number of (succeed|failed) 'ping checks' from 'monitor_ping_thread'.", metric_tags { { "status", "err" } @@ -619,7 +619,7 @@ mon_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_mon_counter::mysql_monitor_read_only_check_ok, - "proxysql_mysql_monitor_read_only_check", + "proxysql_mysql_monitor_read_only_check_total", "Number of (succeed|failed) 'read only checks' from 'monitor_read_only_thread'.", metric_tags { { "status", "ok" } @@ -627,7 +627,7 @@ mon_metrics_map = std::make_tuple( ), std::make_tuple ( p_mon_counter::mysql_monitor_read_only_check_err, - "proxysql_mysql_monitor_read_only_check", + "proxysql_mysql_monitor_read_only_check_total", "Number of (succeed|failed) 'read only checks' from 'monitor_read_only_thread'.", metric_tags { { "status", "err" } @@ -638,7 +638,7 @@ mon_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_mon_counter::mysql_monitor_replication_lag_check_ok, - "proxysql_mysql_monitor_replication_lag_check", + "proxysql_mysql_monitor_replication_lag_check_total", "Number of (succeed|failed)'replication lag checks' from 'monitor_replication_lag_thread'.", metric_tags { { "status", "ok" } @@ -646,7 +646,7 @@ mon_metrics_map = std::make_tuple( ), std::make_tuple ( p_mon_counter::mysql_monitor_replication_lag_check_err, - "proxysql_mysql_monitor_replication_lag_check", + "proxysql_mysql_monitor_replication_lag_check_total", "Number of (succeed|failed)'replication lag checks' from 'monitor_replication_lag_thread'.", metric_tags { { "status", "err" } diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index 097024979..ae64e2d67 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -593,7 +593,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::queries_backends_bytes_sent, - "proxysql_queries_backends_bytes", + "proxysql_queries_backends_bytes_total", "Total number of bytes (sent|received) in backend connections.", metric_tags { { "traffic_flow", "sent" } @@ -601,7 +601,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::queries_backends_bytes_recv, - "proxysql_queries_backends_bytes", + "proxysql_queries_backends_bytes_total", "Total number of bytes (sent|received) in backend connections.", metric_tags { { "traffic_flow", "received" } @@ -612,7 +612,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::queries_frontends_bytes_sent, - "proxysql_queries_frontends_bytes", + "proxysql_queries_frontends_bytes_total", "Total number of bytes (sent|received) in frontend connections.", metric_tags { { "traffic_flow", "sent" } @@ -620,7 +620,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::queries_frontends_bytes_recv, - "proxysql_queries_frontends_bytes", + "proxysql_queries_frontends_bytes_total", "Total number of bytes (sent|received) in frontend connections.", metric_tags { { "traffic_flow", "received" } @@ -631,7 +631,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::client_connections_created, - "proxysql_client_connections", + "proxysql_client_connections_total", "Total number of client connections created or failed (including improperly closed).", metric_tags { { "status", "created" } @@ -639,7 +639,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::client_connections_aborted, - "proxysql_client_connections", + "proxysql_client_connections_total", "Total number of client connections created or failed (including improperly closed).", metric_tags { { "status", "aborted" } @@ -649,13 +649,13 @@ th_metrics_map = std::make_tuple( std::make_tuple ( p_th_counter::query_processor_time_nsec, - "proxysql_query_processor_time_seconds", + "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 {} ), std::make_tuple ( p_th_counter::backend_query_time_nsec, - "proxysql_backend_query_time_seconds", + "proxysql_backend_query_time_seconds_total", "Time spent making network calls to communicate with the backends.", metric_tags {} ), @@ -663,7 +663,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::com_backend_stmt_prepare, - "proxysql_com_backend_stmt", + "proxysql_com_backend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by ProxySQL against the backends.", metric_tags { { "op", "prepare" } @@ -671,7 +671,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::com_backend_stmt_execute, - "proxysql_com_backend_stmt", + "proxysql_com_backend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by ProxySQL against the backends.", metric_tags { { "op", "execute" } @@ -679,7 +679,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::com_backend_stmt_close, - "proxysql_com_backend_stmt", + "proxysql_com_backend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by ProxySQL against the backends.", metric_tags { { "op", "close" } @@ -690,7 +690,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::com_frontend_stmt_prepare, - "proxysql_com_frontend_stmt", + "proxysql_com_frontend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by clients.", metric_tags { { "op", "prepare" } @@ -698,7 +698,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::com_frontend_stmt_execute, - "proxysql_com_frontend_stmt", + "proxysql_com_frontend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by clients.", metric_tags { { "op", "execute" } @@ -706,7 +706,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::com_frontend_stmt_close, - "proxysql_com_frontend_stmt", + "proxysql_com_frontend_stmt_total", "Represents the number of statements (PREPARE|EXECUTE|CLOSE) executed by clients.", metric_tags { { "op", "close" } @@ -716,25 +716,25 @@ th_metrics_map = std::make_tuple( std::make_tuple ( p_th_counter::questions, - "proxysql_questions", + "proxysql_questions_total", "The total number of client requests / statements executed.", metric_tags {} ), std::make_tuple ( p_th_counter::slow_queries, - "proxysql_slow_queries", + "proxysql_slow_queries_total", "The total number of queries with an execution time greater than \"mysql-long_query_time\" milliseconds.", metric_tags {} ), std::make_tuple ( p_th_counter::gtid_consistent_queries, - "proxysql_gtid_consistent_queries", + "proxysql_gtid_consistent_queries_total", "Total queries with GTID consistent read.", metric_tags {} ), std::make_tuple ( p_th_counter::gtid_session_collected, - "proxysql_gtid_session_collected", + "proxysql_gtid_session_collected_total", "Total queries with GTID session state.", metric_tags {} ), @@ -742,7 +742,7 @@ th_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_th_counter::connpool_get_conn_latency_awareness, - "proxysql_connpool_get_conn_success", + "proxysql_connpool_get_conn_success_total", "The connection was picked using the latency awareness algorithm.", metric_tags { { "algorithm", "latency_awareness" } @@ -750,7 +750,7 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::connpool_get_conn_immediate, - "proxysql_connpool_get_conn_success", + "proxysql_connpool_get_conn_success_total", "The connection is provided from per-thread cache.", metric_tags { { "origin", "immediate" } @@ -758,13 +758,13 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::connpool_get_conn_success, - "proxysql_connpool_get_conn_success", + "proxysql_connpool_get_conn_success_total", "The session is able to get a connection, either from per-thread cache or connection pool.", metric_tags {} ), std::make_tuple ( p_th_counter::connpool_get_conn_failure, - "proxysql_connpool_get_conn_failure", + "proxysql_connpool_get_conn_failure_total", "The connection pool cannot provide any connection.", metric_tags {} ), @@ -772,49 +772,49 @@ th_metrics_map = std::make_tuple( std::make_tuple ( p_th_counter::generated_error_packets, - "proxysql_generated_error_packets", + "proxysql_generated_error_packets_total", "Total generated error packets.", metric_tags {} ), std::make_tuple ( p_th_counter::max_connect_timeouts, - "proxysql_max_connect_timeouts", + "proxysql_max_connect_timeouts_total", "Maximum connection timeout reached when trying to connect to backend sever.", metric_tags {} ), std::make_tuple ( p_th_counter::backend_lagging_during_query, - "proxysql_backend_lagging_during_query", + "proxysql_backend_lagging_during_query_total", "Query failed because server was shunned due to lag.", metric_tags {} ), std::make_tuple ( p_th_counter::backend_offline_during_query, - "proxysql_backend_offline_during_query", + "proxysql_backend_offline_during_query_total", "Query failed because server was offline.", metric_tags {} ), std::make_tuple ( p_th_counter::queries_with_max_lag_ms, - "proxysql_queries_with_max_lag_ms", + "proxysql_queries_with_max_lag_ms_total", "Received queries that have a 'max_lag' attribute.", metric_tags {} ), std::make_tuple ( p_th_counter::queries_with_max_lag_ms__delayed, - "proxysql_queries_with_max_lag_ms__delayed", + "proxysql_queries_with_max_lag_ms__delayed_total", "Query delayed because no connection was selected due to 'max_lag' annotation.", metric_tags {} ), std::make_tuple ( p_th_counter::queries_with_max_lag_ms__total_wait_time_us, - "proxysql_queries_with_max_lag_ms__total_wait_time_us", + "proxysql_queries_with_max_lag_ms__total_wait_time_us_total", "Total waited time due to connection selection because of 'max_lag' annotation.", metric_tags {} ), std::make_tuple ( p_th_counter::mysql_unexpected_frontend_com_quit, - "proxysql_mysql_unexpected_frontend_com_quit", + "proxysql_mysql_unexpected_frontend_com_quit_total", "Unexpecte 'COM_QUIT' received from the client.", metric_tags {} ), @@ -827,43 +827,43 @@ th_metrics_map = std::make_tuple( ), std::make_tuple ( p_th_counter::hostgroup_locked_queries, - "proxysql_hostgroup_locked_queries", + "proxysql_hostgroup_locked_queries_total", "Query blocked because connection is locked into some hostgroup but is trying to reach other.", metric_tags {} ), std::make_tuple ( p_th_counter::mysql_unexpected_frontend_packets, - "proxysql_mysql_unexpected_frontend_packets", + "proxysql_mysql_unexpected_frontend_packets_total", "Unexpected packet received from client.", metric_tags {} ), std::make_tuple ( p_th_counter::aws_aurora_replicas_skipped_during_query, - "proxysql_aws_aurora_replicas_skipped_during_query", + "proxysql_aws_aurora_replicas_skipped_during_query_total", "Replicas skipped due to current lag being higher than 'max_lag' annotation.", metric_tags {} ), std::make_tuple ( p_th_counter::automatic_detected_sql_injection, - "proxysql_automatic_detected_sql_injection", + "proxysql_automatic_detected_sql_injection_total", "Blocked a detected 'sql injection' attempt.", metric_tags {} ), std::make_tuple ( p_th_counter::whitelisted_sqli_fingerprint, - "proxysql_whitelisted_sqli_fingerprint", + "proxysql_whitelisted_sqli_fingerprint_total", "Detected a whitelisted 'sql injection' fingerprint.", metric_tags {} ), std::make_tuple ( p_th_counter::mysql_killed_backend_connections, - "proxysql_mysql_killed_backend_connections", + "proxysql_mysql_killed_backend_connections_total", "Number of backend connection killed.", metric_tags {} ), std::make_tuple ( p_th_counter::mysql_killed_backend_queries, - "proxysql_mysql_killed_backend_queries", + "proxysql_mysql_killed_backend_queries_total", "Killed backend queries.", metric_tags {} ) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 9c4510d54..26305bb83 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -587,13 +587,13 @@ admin_metrics_map = std::make_tuple( admin_counter_vector { std::make_tuple ( p_admin_counter::uptime, - "proxysql_uptime_seconds", + "proxysql_uptime_seconds_total", "The total uptime of ProxySQL.", metric_tags {} ), std::make_tuple ( p_admin_counter::jemalloc_allocated, - "proxysql_jemalloc_allocated_bytes", + "proxysql_jemalloc_allocated_bytes_total", "Bytes allocated by the application.", metric_tags {} ) diff --git a/lib/ProxySQL_Cluster.cpp b/lib/ProxySQL_Cluster.cpp index fdfea8877..4030267a6 100644 --- a/lib/ProxySQL_Cluster.cpp +++ b/lib/ProxySQL_Cluster.cpp @@ -1948,13 +1948,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_query_rules_success, - "pulled_mysql_query_rules", + "pulled_mysql_query_rules_total", "Number of times 'mysql_query_rules' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_query_rules_failure, - "pulled_mysql_query_rules", + "pulled_mysql_query_rules_total", "Number of times 'mysql_query_rules' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -1965,13 +1965,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_servers_success, - "pulled_mysql_servers", + "pulled_mysql_servers_total", "Number of times 'mysql_servers' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_failure, - "pulled_mysql_servers", + "pulled_mysql_servers_total", "Number of times 'mysql_servers' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -1980,13 +1980,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_servers_replication_hostgroups_success, - "pulled_mysql_servers_replication_hostgroups", + "pulled_mysql_servers_replication_hostgroups_total", "Number of times 'mysql_servers_replication_hostgroups' have been pulled from a peer.", metric_tags { { "status", "successs" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_replication_hostgroups_failure, - "pulled_mysql_servers_replication_hostgroups", + "pulled_mysql_servers_replication_hostgroups_total", "Number of times 'mysql_servers_replication_hostgroups' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -1994,13 +1994,13 @@ cluster_metrics_map = std::make_tuple( std::make_tuple ( p_cluster_counter::pulled_mysql_servers_group_replication_hostgroups_success, - "pulled_mysql_servers_group_replication_hostgroups", + "pulled_mysql_servers_group_replication_hostgroups_total", "Number of times 'mysql_servers_group_replication_hostgroups' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_group_replication_hostgroups_failure, - "pulled_mysql_servers_group_replication_hostgroups", + "pulled_mysql_servers_group_replication_hostgroups_total", "Number of times 'mysql_servers_group_replication_hostgroups' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2009,13 +2009,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_servers_galera_hostgroups_success, - "pulled_mysql_servers_galera_hostgroups", + "pulled_mysql_servers_galera_hostgroups_total", "Number of times 'mysql_servers_galera_hostgroups' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_galera_hostgroups_failure, - "pulled_mysql_servers_galera_hostgroups", + "pulled_mysql_servers_galera_hostgroups_total", "Number of times 'mysql_servers_galera_hostgroups' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2024,13 +2024,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_servers_aws_aurora_hostgroups_success, - "pulled_mysql_servers_aws_aurora_hostgroups", + "pulled_mysql_servers_aws_aurora_hostgroups_total", "Number of times 'mysql_servers_aws_aurora_hostgroups' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_aws_aurora_hostgroups_failure, - "pulled_mysql_servers_aws_aurora_hostgroups", + "pulled_mysql_servers_aws_aurora_hostgroups_total", "Number of times 'mysql_servers_aws_aurora_hostgroups' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2039,13 +2039,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_servers_runtime_checks_success, - "pulled_mysql_servers_runtime_checks", + "pulled_mysql_servers_runtime_checks_total", "Number of times '' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_servers_runtime_checks_failure, - "pulled_mysql_servers_runtime_checks", + "pulled_mysql_servers_runtime_checks_total", "Number of times 'mysql_servers_runtime_checks' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2056,13 +2056,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_mysql_users_success, - "pulled_mysql_users", + "pulled_mysql_users_total", "Number of times 'mysql_users' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_mysql_users_failure, - "pulled_mysql_users", + "pulled_mysql_users_total", "Number of times 'mysql_users' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2072,13 +2072,13 @@ cluster_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_cluster_counter::pulled_proxysql_servers_success, - "pulled_proxysql_servers", + "pulled_proxysql_servers_total", "Number of times 'mysql_proxysql_servers' have been pulled from a peer.", metric_tags { { "status", "success" } } ), std::make_tuple ( p_cluster_counter::pulled_proxysql_servers_failure, - "pulled_proxysql_servers", + "pulled_proxysql_servers_total", "Number of times 'mysql_proxysql_servers' have been pulled from a peer.", metric_tags { { "status", "failure" } } ), @@ -2087,25 +2087,25 @@ cluster_metrics_map = std::make_tuple( // sync_conflict same epoch std::make_tuple ( p_cluster_counter::sync_conflict_mysql_query_rules_share_epoch, - "sync_conflict_mysql_query_rules_share_epoch", + "sync_conflict_mysql_query_rules_share_epoch_total", "Number of times 'mysql_query_rules' has not been synced because they share the same epoch.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_conflict_mysql_servers_share_epoch, - "sync_conflict_mysql_servers_share_epoch", + "sync_conflict_mysql_servers_share_epoch_total", "Number of times 'mysql_servers' has not been synced because they share the same epoch.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_conflict_proxysql_servers_share_epoch, - "sync_conflict_proxysql_servers_share_epoch", + "sync_conflict_proxysql_servers_share_epoch_total", "Number of times 'proxysql_servers' has not been synced because they share the same epoch.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_conflict_mysql_users_share_epoch, - "sync_conflict_mysql_users_share_epoch", + "sync_conflict_mysql_users_share_epoch_total", "Number of times 'mysql_users' has not been synced because they share the same epoch.", metric_tags {} ), @@ -2113,25 +2113,25 @@ cluster_metrics_map = std::make_tuple( // sync_delayed due to version one std::make_tuple ( p_cluster_counter::sync_delayed_mysql_query_rules_version_one, - "sync_delayed_mysql_query_rules_version_one", + "sync_delayed_mysql_query_rules_version_one_total", "Number of times 'mysql_query_rules' has not been synced because version one doesn't allow sync.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_delayed_mysql_servers_version_one, - "sync_delayed_mysql_servers_version_one", + "sync_delayed_mysql_servers_version_one_total", "Number of times 'mysql_servers' has not been synced because version one doesn't allow sync.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_delayed_mysql_users_version_one, - "sync_delayed_mysql_users_version_one", + "sync_delayed_mysql_users_version_one_total", "Number of times 'mysql_users' has not been synced because version one doesn't allow sync.", metric_tags {} ), std::make_tuple ( p_cluster_counter::sync_delayed_proxysql_servers_version_one, - "sync_delayed_proxysql_servers_version_one", + "sync_delayed_proxysql_servers_version_one_total", "Number of times 'proxysql_servers' has not been synced because version one doesn't allow sync.", metric_tags {} ) diff --git a/lib/Query_Cache.cpp b/lib/Query_Cache.cpp index e622e986d..846165444 100644 --- a/lib/Query_Cache.cpp +++ b/lib/Query_Cache.cpp @@ -332,13 +332,13 @@ qc_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_qc_counter::query_cache_count_get, - "proxysql_query_cache_count_get", + "proxysql_query_cache_count_get_total", "Number of read requests.", metric_tags {} ), std::make_tuple ( p_qc_counter::query_cache_count_get_ok, - "proxysql_query_cache_count_get", + "proxysql_query_cache_count_get_total", "Number of successful read requests.", metric_tags { { "status", "ok" } @@ -348,7 +348,7 @@ qc_metrics_map = std::make_tuple( std::make_tuple ( p_qc_counter::query_cache_count_set, - "proxysql_query_cache_count_set", + "proxysql_query_cache_count_set_total", "Number of write requests.", metric_tags {} ), @@ -356,7 +356,7 @@ qc_metrics_map = std::make_tuple( // ==================================================================== std::make_tuple ( p_qc_counter::query_cache_bytes_in, - "proxysql_query_cache_bytes", + "proxysql_query_cache_bytes_total", "Number of bytes (read|written) into the Query Cache.", metric_tags { { "op", "written" } @@ -364,7 +364,7 @@ qc_metrics_map = std::make_tuple( ), std::make_tuple ( p_qc_counter::query_cache_bytes_out, - "proxysql_query_cache_bytes", + "proxysql_query_cache_bytes_total", "Number of bytes (read|written) into the Query Cache.", metric_tags { { "op", "read" } @@ -374,13 +374,13 @@ qc_metrics_map = std::make_tuple( std::make_tuple ( p_qc_counter::query_cache_purged, - "proxysql_query_cache_purged", + "proxysql_query_cache_purged_total", "Number of entries purged by the Query Cache due to TTL expiration.", metric_tags {} ), std::make_tuple ( p_qc_counter::query_cache_entries, - "proxysql_query_cache_entries", + "proxysql_query_cache_entries_total", "Number of entries currently stored in the query cache.", metric_tags {} )