From 535e8cc889deb79c739b0b8d76ac3a97594205fa Mon Sep 17 00:00:00 2001 From: Ian Bucad Date: Tue, 5 Oct 2021 13:30:21 +1100 Subject: [PATCH] correct unit for pool.latency_ms --- proxysql/datadog_checks/proxysql/queries.py | 6 +++++- proxysql/metadata.csv | 1 + proxysql/tests/common.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/proxysql/datadog_checks/proxysql/queries.py b/proxysql/datadog_checks/proxysql/queries.py index 9cce0ae715f163..8ff835d01f0a46 100644 --- a/proxysql/datadog_checks/proxysql/queries.py +++ b/proxysql/datadog_checks/proxysql/queries.py @@ -139,7 +139,7 @@ 'name': 'stats_mysql_connection_pool', # Need explicit selections as some columns are unusable. 'query': 'SELECT hostgroup, srv_host, srv_port, status, ConnUsed, ConnFree, ConnOK, ConnERR, Queries, ' - 'Bytes_data_sent, Bytes_data_recv, Latency_us FROM stats_mysql_connection_pool', + 'Bytes_data_sent, Bytes_data_recv, (Latency_us/1000.0) as Latency_ms, Latency_us FROM stats_mysql_connection_pool', 'columns': [ # the hostgroup in which the backend server belongs. Note that a single backend server can belong to more # than one hostgroup @@ -178,7 +178,11 @@ # OK/ERR packets, fields' description, etc) {'name': 'pool.bytes_data_recv', 'type': 'rate'}, # the currently ping time in microseconds, as reported from Monitor + # Latency_ms is a ProxySQL typo fixed in ProxySQL 1.3.3; it has been aptly renamed to Latency_us. + # See: https://github.com/sysown/proxysql/issues/882 {'name': 'pool.latency_ms', 'type': 'gauge'}, + # the currently ping time in microseconds, as reported from Monitor + {'name': 'pool.latency_us', 'type': 'gauge'}, ], } diff --git a/proxysql/metadata.csv b/proxysql/metadata.csv index 27cf6e1dfdb47e..52480a0447bc69 100644 --- a/proxysql/metadata.csv +++ b/proxysql/metadata.csv @@ -56,6 +56,7 @@ proxysql.pool.queries,gauge,,query,second,The number of queries routed towards t proxysql.pool.bytes_data_sent,gauge,,byte,second,The amount of data sent to the backend.,0,proxysql,connection_pool_bytes_sent proxysql.pool.bytes_data_recv,gauge,,byte,second,The amount of data received from the backend.,0,proxysql,connection_pool_bytes_received proxysql.pool.latency_ms,gauge,,millisecond,,"The current ping time as reported from Monitor.",-1,proxysql,connection_pool_backend_latency +proxysql.pool.latency_us,gauge,,microsecond,,"The current ping time as reported from Monitor.",-1,proxysql,connection_pool_backend_latency proxysql.memory.sqlite3_memory_bytes,gauge,,byte,,Memory used by the embedded SQLite.,0,proxysql,sqlite_memory proxysql.memory.jemalloc_resident,gauge,,byte,,Bytes in physically resident data pages mapped by the allocator.,0,proxysql,jemalloc_resident_memory proxysql.memory.jemalloc_active,gauge,,byte,,Bytes in pages allocated by the application.,0,proxysql,jemalloc_active_memory diff --git a/proxysql/tests/common.py b/proxysql/tests/common.py index 38bf505b62c773..38341a6e7c9eed 100644 --- a/proxysql/tests/common.py +++ b/proxysql/tests/common.py @@ -72,6 +72,7 @@ 'proxysql.pool.bytes_data_sent', 'proxysql.pool.bytes_data_recv', 'proxysql.pool.latency_ms', + 'proxysql.pool.latency_us', ) USER_TAGS_METRICS = (