diff --git a/mysql/datadog_checks/mysql/const.py b/mysql/datadog_checks/mysql/const.py index fae5a26429a89..553150e71038b 100644 --- a/mysql/datadog_checks/mysql/const.py +++ b/mysql/datadog_checks/mysql/const.py @@ -11,6 +11,7 @@ # Vars found in "SHOW STATUS;" STATUS_VARS = { # Command Metrics + 'Prepared_stmt_count': ('mysql.performance.prepared_stmt_count', GAUGE), 'Slow_queries': ('mysql.performance.slow_queries', RATE), 'Questions': ('mysql.performance.questions', RATE), 'Queries': ('mysql.performance.queries', RATE), @@ -63,6 +64,7 @@ 'Key_buffer_size': ('mysql.myisam.key_buffer_size', GAUGE), 'Key_cache_utilization': ('mysql.performance.key_cache_utilization', GAUGE), 'max_connections': ('mysql.net.max_connections_available', GAUGE), + 'max_prepared_stmt_count': ('mysql.performance.max_prepared_stmt_count', GAUGE), 'query_cache_size': ('mysql.performance.qcache_size', GAUGE), 'table_open_cache': ('mysql.performance.table_open_cache', GAUGE), 'thread_cache_size': ('mysql.performance.thread_cache_size', GAUGE), diff --git a/mysql/metadata.csv b/mysql/metadata.csv index 91a6c68a600fe..b88c49bd82f91 100644 --- a/mysql/metadata.csv +++ b/mysql/metadata.csv @@ -34,6 +34,7 @@ mysql.performance.open_files,gauge,,file,,The number of open files.,0,mysql,open mysql.performance.open_tables,gauge,,table,,The number of of tables that are open.,0,mysql,open tables mysql.performance.qcache_hits,gauge,,hit,second,The rate of query cache hits.,0,mysql,query cache hits mysql.performance.questions,gauge,,query,second,The rate of statements executed by the server.,0,mysql,questions +mysql.performance.prepared_stmt_count,gauge,,query,second,The current number of prepared statements.,0,mysql,current prepared statements mysql.performance.slow_queries,gauge,,query,second,The rate of slow queries.,-1,mysql,slow queries mysql.performance.table_locks_waited,gauge,,,,The total number of times that a request for a table lock could not be granted immediately and a wait was needed.,-1,mysql,table locks waited mysql.performance.table_locks_waited.rate,gauge,,,,"The rate of times that a request for a table lock could not be granted immediately and a wait was needed.",0,mysql,table locks waited rate @@ -60,6 +61,7 @@ mysql.myisam.key_reads,gauge,,read,second,"The number of physical reads of a key mysql.myisam.key_write_requests,gauge,,write,second,"The number of requests to write a key block to the MyISAM key cache.",0,mysql,mysql myisam key_write_requests mysql.myisam.key_writes,gauge,,write,second,"The number of physical writes of a key block from the MyISAM key cache to disk.",0,mysql,mysql myisam key_writes mysql.myisam.key_buffer_size,gauge,,byte,,"Size of the buffer used for index blocks.",0,mysql,mysql myisam key_buffer_size +mysql.performance.max_prepared_stmt_count,gauge,,,,"The maximum allowed prepared statements on the server.",0,mysql,max prepared statements mysql.performance.qcache_size,gauge,,byte,,"The amount of memory allocated for caching query results.",0,mysql,mysql performance qcache_size mysql.performance.table_open_cache,gauge,,,,"The number of open tables for all threads. Increasing this value increases the number of file descriptors that mysqld requires.",0,mysql,mysql performance table_open_cache mysql.performance.thread_cache_size,gauge,,byte,,"How many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache if there are fewer than thread_cache_size threads there.",0,mysql,mysql performance thread_cache_size diff --git a/mysql/tests/variables.py b/mysql/tests/variables.py index 3b980fec49e65..6bf41793d5077 100644 --- a/mysql/tests/variables.py +++ b/mysql/tests/variables.py @@ -3,6 +3,7 @@ # Licensed under a 3-clause BSD style license (see LICENSE) STATUS_VARS = [ # Command Metrics + 'mysql.performance.prepared_stmt_count', 'mysql.performance.slow_queries', 'mysql.performance.questions', 'mysql.performance.queries', @@ -58,6 +59,7 @@ 'mysql.myisam.key_buffer_size', 'mysql.performance.key_cache_utilization', 'mysql.net.max_connections_available', + 'mysql.performance.max_prepared_stmt_count', 'mysql.performance.table_open_cache', 'mysql.performance.thread_cache_size', ]