From 9d50ba3edefeb6f8205d18b1231f43fc0704257e Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 25 Jul 2023 03:57:48 +0800 Subject: [PATCH 01/12] Mixin: - Switch to timeseries - Use 'last' in stat panels Signed-off-by: Vitaly --- mysqld-mixin/dashboards/mysql-overview.json | 4411 ++++++++++--------- 1 file changed, 2380 insertions(+), 2031 deletions(-) diff --git a/mysqld-mixin/dashboards/mysql-overview.json b/mysqld-mixin/dashboards/mysql-overview.json index 2d4782df..55afa865 100644 --- a/mysqld-mixin/dashboards/mysql-overview.json +++ b/mysqld-mixin/dashboards/mysql-overview.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -14,15 +17,18 @@ }, "description": "", "editable": true, + "fiscalYearStartMonth": 0, "gnetId": 11323, "graphTooltip": 1, - "id": 31, - "iteration": 1603186191702, + "id": 6, "links": [], + "liveNow": false, "panels": [ { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -31,20 +37,25 @@ }, "id": 382, "panels": [], - "repeat": null, - "title": "", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "type": "row" }, { - "cacheTimeout": null, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "description": "**Uptime**\n\nThe amount of time since the last restart of the MySQL server process.", "fieldConfig": { "defaults": { - "custom": {}, "decimals": 1, "mappings": [], - "nullValueMode": "connected", "thresholds": { "mode": "absolute", "steps": [ @@ -88,16 +99,20 @@ "orientation": "horizontal", "reduceOptions": { "calcs": [ - "mean" + "last" ], "fields": "", "values": false - } + }, + "textMode": "auto" }, - "pluginVersion": "7.0.4", + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "10m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_uptime{job=~\"$job\", instance=~\"$instance\"}", @@ -114,15 +129,14 @@ "type": "stat" }, { - "cacheTimeout": null, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "description": "**Current QPS**\n\nBased on the queries reported by MySQL's ``SHOW STATUS`` command, it is the number of statements executed by the server within the last second. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count \n``COM_PING`` or ``COM_STATISTICS`` commands.", "fieldConfig": { "defaults": { - "custom": {}, "decimals": 2, "mappings": [], - "nullValueMode": "connected", "thresholds": { "mode": "absolute", "steps": [ @@ -172,16 +186,20 @@ "orientation": "horizontal", "reduceOptions": { "calcs": [ - "mean" + "last" ], "fields": "", "values": false - } + }, + "textMode": "auto" }, - "pluginVersion": "7.0.4", + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "10m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_queries{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -198,15 +216,14 @@ "type": "stat" }, { - "cacheTimeout": null, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "description": "**InnoDB Buffer Pool Size**\n\nInnoDB maintains a storage area called the buffer pool for caching data and indexes in memory. Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is one of the most important aspects of MySQL tuning. The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory on a dedicated database host, but depends on many factors.", "fieldConfig": { "defaults": { - "custom": {}, "decimals": 0, "mappings": [], - "nullValueMode": "connected", "thresholds": { "mode": "absolute", "steps": [ @@ -256,16 +273,20 @@ "orientation": "horizontal", "reduceOptions": { "calcs": [ - "mean" + "last" ], "fields": "", "values": false - } + }, + "textMode": "auto" }, - "pluginVersion": "7.0.4", + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "10m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_variables_innodb_buffer_pool_size{job=~\"$job\", instance=~\"$instance\"}", @@ -283,7 +304,9 @@ }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -292,53 +315,97 @@ }, "id": 383, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Connections", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 0, + "datasource": { + "uid": "$datasource" + }, "description": "**Max Connections** \n\nMax Connections is the maximum permitted number of simultaneous client connections. By default, this is 151. Increasing this value increases the number of file descriptors that mysqld requires. If the required number of descriptors are not available, the server reduces the value of Max Connections.\n\nmysqld actually permits Max Connections + 1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege, such as root.\n\nMax Used Connections is the maximum number of connections that have been in use simultaneously since the server started.\n\nConnections is the number of connection attempts (successful or not) to the MySQL server.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max Connections" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 5 }, - "height": "250px", - "hiddenSeries": false, "id": 92, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "targetBlank": true, @@ -346,26 +413,29 @@ "url": "https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Max Connections", - "fill": 0 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(max_over_time(mysql_global_status_threads_connected{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -379,6 +449,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(mysql_global_status_max_used_connections{job=~\"$job\", instance=~\"$instance\"})", @@ -393,6 +466,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(mysql_global_variables_max_connections{job=~\"$job\", instance=~\"$instance\"})", @@ -406,123 +482,158 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Connections", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Active Threads**\n\nThreads Connected is the number of open connections, while Threads Running is the number of threads not sleeping.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Threads", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Peak Threads Running" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + }, + { + "id": "custom.lineWidth", + "value": 0 + }, + { + "id": "custom.pointSize", + "value": 4 + }, + { + "id": "custom.showPoints", + "value": "always" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Peak Threads Connected" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#1F78C1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Avg Threads Running" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 5 }, - "hiddenSeries": false, "id": 10, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Peak Threads Running", - "color": "#E24D42", - "lines": false, - "pointradius": 1, - "points": true - }, - { - "alias": "Peak Threads Connected", - "color": "#1F78C1" + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - { - "alias": "Avg Threads Running", - "color": "#EAB839" + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(max_over_time(mysql_global_status_threads_connected{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -537,6 +648,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(max_over_time(mysql_global_status_threads_running{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -549,6 +663,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(avg_over_time(mysql_global_status_threads_running{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "interval": "1m", @@ -558,53 +675,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Client Thread Activity", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [ - "total" - ] - }, - "yaxes": [ - { - "format": "short", - "label": "Threads", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -613,53 +691,84 @@ }, "id": 384, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Table Locks", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Questions**\n\nThe number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries used in the QPS calculation. \n\nThis variable does not count the following commands:\n* ``COM_PING``\n* ``COM_STATISTICS``\n* ``COM_STMT_PREPARE``\n* ``COM_STMT_CLOSE``\n* ``COM_STMT_RESET``", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 13 }, - "hiddenSeries": false, "id": 53, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "targetBlank": true, @@ -667,21 +776,29 @@ "url": "https://www.percona.com/blog/2014/05/29/how-mysql-queries-and-questions-are-measured/" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_questions{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -694,115 +811,118 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Questions", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Thread Cache**\n\nThe thread_cache_size variable sets how many threads the server should cache to reuse. When a client disconnects, the client's threads are put in the cache if the cache is not full. It is autosized in MySQL 5.6.8 and above (capped to 100). Requests for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache is empty is a new thread created.\n\n* *Threads_created*: The number of threads created to handle connections.\n* *Threads_cached*: The number of threads in the thread cache.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Threads Created" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 13 }, - "hiddenSeries": false, "id": 11, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "title": "Tuning information", "url": "https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_thread_cache_size" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Threads Created", - "fill": 0 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(mysql_global_variables_thread_cache_size{job=~\"$job\", instance=~\"$instance\"})", @@ -816,6 +936,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(mysql_global_status_threads_cached{job=~\"$job\", instance=~\"$instance\"})", @@ -829,6 +952,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_threads_created{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -841,49 +967,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Thread Cache", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -892,68 +983,108 @@ }, "id": 385, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Temporary Objects", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "MySQL Temporary Objects", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 21 }, - "hiddenSeries": false, "id": 22, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_created_tmp_tables{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -966,6 +1097,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_created_tmp_disk_tables{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -978,6 +1112,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_created_tmp_files{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -989,108 +1126,121 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Temporary Objects", - "description": "MySQL Temporary Objects", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Select Types**\n\nAs with most relational databases, selecting based on indexes is more efficient than scanning an entire table's data. Here we see the counters for selects not done with indexes.\n\n* ***Select Scan*** is how many queries caused full table scans, in which all the data in the table had to be read and either discarded or returned.\n* ***Select Range*** is how many queries used a range scan, which means MySQL scanned all rows in a given range.\n* ***Select Full Join*** is the number of joins that are not joined on an index, this is usually a huge performance hit.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} - }, - "overrides": [] - }, - "fill": 2, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 21 - }, - "height": "250px", - "hiddenSeries": false, + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 21 + }, "id": 311, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_select_full_join{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1104,6 +1254,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_select_full_range_join{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1117,6 +1270,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_select_range{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1130,6 +1286,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_select_range_check{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1143,6 +1302,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_select_scan{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1155,49 +1317,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Select Types", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -1206,70 +1333,129 @@ }, "id": 386, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Sorts", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Sorts**\n\nDue to a query's structure, order, or other requirements, MySQL sorts the rows before returning them. For example, if a table is ordered 1 to 10 but you want the results reversed, MySQL then has to sort the rows to return 10 to 1.\n\nThis graph also shows when sorts had to scan a whole table or a given range of a table in order to return the results and which could not have been sorted via an index.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 29 }, - "hiddenSeries": false, "id": 30, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_sort_rows{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1283,6 +1469,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_sort_range{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1296,6 +1485,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_sort_merge_passes{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1309,6 +1501,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_sort_scan{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1321,104 +1516,100 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Sorts", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Slow Queries**\n\nSlow queries are defined as queries being slower than the long_query_time setting. For example, if you have long_query_time set to 3, all queries that take longer than 3 seconds to complete will show on this graph.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 29 }, - "hiddenSeries": false, "id": 48, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_slow_queries{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1431,51 +1622,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Slow Queries", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -1484,68 +1638,108 @@ }, "id": 387, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Aborted", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**Aborted Connections**\n\nWhen a given host connects to MySQL and the connection is interrupted in the middle (for example due to bad credentials), MySQL keeps that info in a system table (since 5.6 this table is exposed in performance_schema).\n\nIf the amount of failed requests without a successful connection reaches the value of max_connect_errors, mysqld assumes that something is wrong and blocks the host from further connection.\n\nTo allow connections from that host again, you need to issue the ``FLUSH HOSTS`` statement.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 37 }, - "hiddenSeries": false, "id": 47, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_aborted_connects{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1559,6 +1753,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_aborted_clients{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1572,107 +1769,100 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Aborted Connections", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**Table Locks**\n\nMySQL takes a number of different locks for varying reasons. In this graph we see how many Table level locks MySQL has requested from the storage engine. In the case of InnoDB, many times the locks could actually be row locks as it only takes table level locks in a few specific cases.\n\nIt is most useful to compare Locks Immediate and Locks Waited. If Locks waited is rising, it means you have lock contention. Otherwise, Locks Immediate rising and falling is normal activity.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 37 }, - "hiddenSeries": false, "id": 32, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_table_locks_immediate{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1686,6 +1876,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_table_locks_waited{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1698,49 +1891,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Table Locks", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -1749,69 +1907,108 @@ }, "id": 388, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Network", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Network Traffic**\n\nHere we can see how much network traffic is generated by MySQL. Outbound is network traffic sent from MySQL and Inbound is network traffic MySQL has received.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 6, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 45 }, - "hiddenSeries": false, "id": 9, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_bytes_received{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1825,6 +2022,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "sum(rate(mysql_global_status_bytes_sent{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -1837,49 +2037,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Network Traffic", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "none", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -1888,81 +2053,172 @@ }, "id": 389, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Memory", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 0, + "datasource": { + "uid": "$datasource" + }, "description": "***System Memory***: Total Memory for the system.\\\n***InnoDB Buffer Pool Data***: InnoDB maintains a storage area called the buffer pool for caching data and indexes in memory.\\\n***TokuDB Cache Size***: Similar in function to the InnoDB Buffer Pool, TokuDB will allocate 50% of the installed RAM for its own cache.\\\n***Key Buffer Size***: Index blocks for MYISAM tables are buffered and are shared by all threads. key_buffer_size is the size of the buffer used for index blocks.\\\n***Adaptive Hash Index Size***: When InnoDB notices that some index values are being accessed very frequently, it builds a hash index for them in memory on top of B-Tree indexes.\\\n ***Query Cache Size***: The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. The query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time.\\\n***InnoDB Dictionary Size***: The data dictionary is InnoDB ‘s internal catalog of tables. InnoDB stores the data dictionary on disk, and loads entries into memory while the server is running.\\\n***InnoDB Log Buffer Size***: The MySQL InnoDB log buffer allows transactions to run without having to write the log to disk before the transactions commit.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} - }, - "overrides": [] - }, - "fill": 6, - "fillGradient": 0, - "grid": {}, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 53 - }, - "hiddenSeries": false, - "id": 50, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [ + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "System Memory" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.stacking", + "value": { + "group": "A", + "mode": "none" + } + } + ] + }, + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + }, + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsNull", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 53 + }, + "id": 50, + "links": [ { "title": "Detailed descriptions about metrics", "url": "https://www.percona.com/doc/percona-monitoring-and-management/dashboard.mysql-overview.html#mysql-internal-memory-overview" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "System Memory", - "fill": 0, - "stack": false + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_status_innodb_page_size{job=~\"$job\", instance=~\"$instance\"} * on (instance) mysql_global_status_buffer_pool_pages{job=~\"$job\", instance=~\"$instance\", state=\"data\"})", "format": "time_series", "hide": false, @@ -1973,6 +2229,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_variables_innodb_log_buffer_size{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -1982,6 +2241,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_variables_innodb_additional_mem_pool_size{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -1991,6 +2253,9 @@ "step": 40 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_status_innodb_mem_dictionary{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -2000,6 +2265,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_variables_key_buffer_size{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -2009,6 +2277,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_variables_query_cache_size{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -2018,6 +2289,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_status_innodb_mem_adaptive_hash{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -2027,6 +2301,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "sum(mysql_global_variables_tokudb_cache_size{job=~\"$job\", instance=~\"$instance\"})", "format": "time_series", "interval": "1m", @@ -2036,51 +2313,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Internal Memory Overview", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -2089,76 +2329,113 @@ }, "id": 390, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Command, Handlers, Processes", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**Top Command Counters**\n\nThe Com_{{xxx}} statement counter variables indicate the number of times each xxx statement has been executed. There is one status variable for each type of statement. For example, Com_delete and Com_update count [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements, respectively. Com_delete_multi and Com_update_multi are similar but apply to [``DELETE``](https://dev.mysql.com/doc/refman/5.7/en/delete.html) and [``UPDATE``](https://dev.mysql.com/doc/refman/5.7/en/update.html) statements that use multiple-table syntax.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 61 }, - "hiddenSeries": false, "id": 14, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideEmpty": false, - "hideZero": false, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "title": "Server Status Variables (Com_xxx)", "url": "https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx" } ], - "nullPointMode": "null as zero", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "topk(5, rate(mysql_global_status_commands_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])>0)", @@ -2172,106 +2449,121 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Top Command Counters", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Handlers**\n\nHandler statistics are internal statistics on how MySQL is selecting, updating, inserting, and modifying rows, tables, and indexes.\n\nThis is in fact the layer between the Storage Engine and MySQL.\n\n* `read_rnd_next` is incremented when the server performs a full table scan and this is a counter you don't really want to see with a high value.\n* `read_key` is incremented when a read is done with an index.\n* `read_next` is incremented when the storage engine is asked to 'read the next index entry'. A high value means a lot of index scans are being done.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 68 }, - "hiddenSeries": false, "id": 8, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_handlers_total{job=~\"$job\",instance=~\"$instance\", handler!~\"commit|rollback|savepoint.*|prepare\"}[$__rate_interval])", @@ -2284,105 +2576,121 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Handlers", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "MySQL Transaction Handlers", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 75 }, - "hiddenSeries": false, "id": 28, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_handlers_total{job=~\"$job\",instance=~\"$instance\", handler=~\"commit|rollback|savepoint.*|prepare\"}[$__rate_interval])", @@ -2394,106 +2702,120 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Transaction Handlers", - "description": "MySQL Transaction Handlers", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "Process States", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 82 }, - "hiddenSeries": false, "id": 40, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null as zero", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_info_schema_processlist_threads{job=~\"$job\", instance=~\"$instance\"}", @@ -2506,106 +2828,120 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Process States", - "description": "Process States", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "Top Process States Hourly", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 100, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + } + ] }, - "fill": 6, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 89 }, - "hiddenSeries": false, "id": 49, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "topk(5, avg_over_time(mysql_info_schema_processlist_threads{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", @@ -2617,50 +2953,15 @@ "step": 3600 } ], - "thresholds": [], "timeFrom": "24h", - "timeRegions": [], - "timeShift": null, "title": "Top Process States Hourly", - "description": "Top Process States Hourly", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -2669,69 +2970,108 @@ }, "id": 391, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Query Cache", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Query Cache Memory**\n\nThe query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time. This serialization is true not only for SELECTs, but also for INSERT/UPDATE/DELETE.\n\nThis also means that the larger the `query_cache_size` is set to, the slower those operations become. In concurrent environments, the MySQL Query Cache quickly becomes a contention point, decreasing performance. MariaDB and AWS Aurora have done work to try and eliminate the query cache contention in their flavors of MySQL, while MySQL 8.0 has eliminated the query cache feature.\n\nThe recommended settings for most environments is to set:\n ``query_cache_type=0``\n ``query_cache_size=0``\n\nNote that while you can dynamically change these values, to completely remove the contention point you have to restart the database.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 97 }, - "hiddenSeries": false, "id": 46, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_qcache_free_memory{job=~\"$job\", instance=~\"$instance\"}", @@ -2745,118 +3085,115 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, - "expr": "mysql_global_variables_query_cache_size{job=~\"$job\", instance=~\"$instance\"}", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Query Cache Size", - "metric": "", - "refId": "E", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "MySQL Query Cache Memory", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true + "expr": "mysql_global_variables_query_cache_size{job=~\"$job\", instance=~\"$instance\"}", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Query Cache Size", + "metric": "", + "refId": "E", + "step": 20 } ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "MySQL Query Cache Memory", + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Query Cache Activity**\n\nThe query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time. This serialization is true not only for SELECTs, but also for INSERT/UPDATE/DELETE.\n\nThis also means that the larger the `query_cache_size` is set to, the slower those operations become. In concurrent environments, the MySQL Query Cache quickly becomes a contention point, decreasing performance. MariaDB and AWS Aurora have done work to try and eliminate the query cache contention in their flavors of MySQL, while MySQL 8.0 has eliminated the query cache feature.\n\nThe recommended settings for most environments is to set:\n``query_cache_type=0``\n``query_cache_size=0``\n\nNote that while you can dynamically change these values, to completely remove the contention point you have to restart the database.", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 97 }, - "height": "", - "hiddenSeries": false, "id": 45, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_qcache_hits{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -2870,6 +3207,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_qcache_inserts{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -2883,6 +3223,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_qcache_not_cached{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -2896,6 +3239,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_qcache_lowmem_prunes{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -2909,6 +3255,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_qcache_queries_in_cache{job=~\"$job\", instance=~\"$instance\"}", @@ -2921,49 +3270,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Query Cache Activity", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -2972,68 +3286,108 @@ }, "id": 392, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Files and Tables", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "MySQL File Openings", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 105 }, - "hiddenSeries": false, "id": 43, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_opened_files{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -3045,105 +3399,100 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL File Openings", - "description": "MySQL File Openings", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, - "editable": true, - "error": false, + "datasource": { + "uid": "$datasource" + }, + "description": "MySQL Open Files", "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 105 }, - "hiddenSeries": false, "id": 41, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_open_files{job=~\"$job\", instance=~\"$instance\"}", @@ -3156,6 +3505,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_variables_open_files_limit{job=~\"$job\", instance=~\"$instance\"}", @@ -3167,6 +3519,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "mysql_global_status_innodb_num_open_files{job=~\"$job\", instance=~\"$instance\"}", "interval": "1m", "intervalFactor": 1, @@ -3175,50 +3530,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Open Files", - "description": "MySQL Open Files", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -3227,79 +3546,126 @@ }, "id": 393, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "Table Openings", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Table Open Cache Status**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Table Open Cache Hit Ratio" + }, + "properties": [ + { + "id": "unit", + "value": "percentunit" + } + ] + } + ] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 113 }, - "hiddenSeries": false, "id": 44, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "title": "Server Status Variables (table_open_cache)", "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Table Open Cache Hit Ratio", - "yaxis": 2 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "rate(mysql_global_status_opened_tables{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -3312,6 +3678,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "rate(mysql_global_status_table_open_cache_hits{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "interval": "1m", @@ -3321,6 +3690,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "rate(mysql_global_status_table_open_cache_misses{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "interval": "1m", @@ -3330,6 +3702,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "rate(mysql_global_status_table_open_cache_overflows{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "interval": "1m", @@ -3339,6 +3714,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "rate(mysql_global_status_table_open_cache_hits{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])/(rate(mysql_global_status_table_open_cache_hits{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])+rate(mysql_global_status_table_open_cache_misses{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "interval": "1m", @@ -3348,110 +3726,105 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Table Open Cache Status", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "percentunit", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Open Tables**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 113 }, - "hiddenSeries": false, "id": 42, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "title": "Server Status Variables (table_open_cache)", "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_open_tables{job=~\"$job\", instance=~\"$instance\"}", @@ -3465,6 +3838,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_variables_table_open_cache{job=~\"$job\", instance=~\"$instance\"}", @@ -3477,49 +3853,14 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Open Tables", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { "collapsed": false, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "gridPos": { "h": 1, "w": 24, @@ -3528,79 +3869,113 @@ }, "id": 394, "panels": [], - "repeat": null, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], "title": "MySQL Table Definition Cache", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "decimals": 2, + "datasource": { + "uid": "$datasource" + }, "description": "**MySQL Table Definition Cache**\n\nThe recommendation is to set the `table_open_cache_instances` to a loose correlation to virtual CPUs, keeping in mind that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each cache will only have 50 cached.\n\nThe `table_definition_cache` and `table_open_cache` can be left as default as they are auto-sized MySQL 5.6 and above (ie: do not set them to any value).", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "unit": "short", - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 2, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 121 }, - "hiddenSeries": false, "id": 54, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, "links": [ { "title": "Server Status Variables (table_open_cache)", "url": "http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_table_open_cache" } ], - "nullPointMode": "null", "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Opened Table Definitions", - "yaxis": 2 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.0.2", "targets": [ { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_status_open_table_definitions{job=~\"$job\", instance=~\"$instance\"}", @@ -3614,6 +3989,9 @@ }, { "calculatedInterval": "2m", + "datasource": { + "uid": "$datasource" + }, "datasourceErrors": {}, "errors": {}, "expr": "mysql_global_variables_table_definition_cache{job=~\"$job\", instance=~\"$instance\"}", @@ -3626,6 +4004,9 @@ "step": 20 }, { + "datasource": { + "uid": "$datasource" + }, "expr": "rate(mysql_global_status_opened_table_definitions{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "interval": "1m", @@ -3635,49 +4016,12 @@ "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MySQL Table Definition Cache", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" } ], "refresh": "10s", - "schemaVersion": 25, + "schemaVersion": 38, "style": "dark", "tags": [], "templating": { @@ -3704,12 +4048,16 @@ "allValue": ".+", "current": { "selected": true, - "text": "hosted-grafana/cloudsql-proxy-mysql-exporter", + "text": [ + "All" + ], "value": [ - "hosted-grafana/cloudsql-proxy-mysql-exporter" + "$__all" ] }, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "definition": "label_values(mysql_up, job)", "hide": 0, "includeAll": true, @@ -3723,7 +4071,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -3738,7 +4085,9 @@ "$__all" ] }, - "datasource": "$datasource", + "datasource": { + "uid": "$datasource" + }, "definition": "label_values(mysql_up, instance)", "hide": 0, "includeAll": true, @@ -3752,7 +4101,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -3797,5 +4145,6 @@ "timezone": "", "title": "MySQL", "uid": "549c2bf8936f7767ea6ac47c47b00f2a", - "version": 1 + "version": 5, + "weekStart": "" } From 83ff71e6b64f01c5699b16671961754c27316006 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 25 Jul 2023 04:40:10 +0800 Subject: [PATCH 02/12] Add units Signed-off-by: Vitaly --- mysqld-mixin/dashboards/mysql-overview.json | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mysqld-mixin/dashboards/mysql-overview.json b/mysqld-mixin/dashboards/mysql-overview.json index 55afa865..c0c6a730 100644 --- a/mysqld-mixin/dashboards/mysql-overview.json +++ b/mysqld-mixin/dashboards/mysql-overview.json @@ -20,7 +20,7 @@ "fiscalYearStartMonth": 0, "gnetId": 11323, "graphTooltip": 1, - "id": 6, + "id": 9, "links": [], "liveNow": false, "panels": [ @@ -1974,7 +1974,7 @@ } ] }, - "unit": "short" + "unit": "Bps" }, "overrides": [] }, @@ -2120,7 +2120,7 @@ } ] }, - "unit": "short" + "unit": "bytes" }, "overrides": [ { @@ -3037,7 +3037,7 @@ } ] }, - "unit": "short" + "unit": "bytes" }, "overrides": [] }, @@ -4029,8 +4029,8 @@ { "current": { "selected": false, - "text": "prometheus", - "value": "prometheus" + "text": "grafanacloud-k3d-prom", + "value": "grafanacloud-k3d-prom" }, "hide": 0, "includeAll": false, @@ -4078,11 +4078,12 @@ { "allValue": ".+", "current": { - "selected": true, - "tags": [], - "text": "All", + "selected": false, + "text": [ + "static:mysql.sample-apps.svc.cluster.local:3306" + ], "value": [ - "$__all" + "static:mysql.sample-apps.svc.cluster.local:3306" ] }, "datasource": { @@ -4145,6 +4146,6 @@ "timezone": "", "title": "MySQL", "uid": "549c2bf8936f7767ea6ac47c47b00f2a", - "version": 5, + "version": 10, "weekStart": "" -} +} \ No newline at end of file From 874f3b64bb5a1aa9bb26354b017807d4678b1036 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 25 Jul 2023 04:46:22 +0800 Subject: [PATCH 03/12] Chain instance variable to job Signed-off-by: Vitaly --- mysqld-mixin/dashboards/mysql-overview.json | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mysqld-mixin/dashboards/mysql-overview.json b/mysqld-mixin/dashboards/mysql-overview.json index c0c6a730..42723e4a 100644 --- a/mysqld-mixin/dashboards/mysql-overview.json +++ b/mysqld-mixin/dashboards/mysql-overview.json @@ -4028,9 +4028,9 @@ "list": [ { "current": { - "selected": false, - "text": "grafanacloud-k3d-prom", - "value": "grafanacloud-k3d-prom" + "selected": true, + "text": "prometheus", + "value": "prometheus" }, "hide": 0, "includeAll": false, @@ -4039,6 +4039,7 @@ "name": "datasource", "options": [], "query": "prometheus", + "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -4078,25 +4079,25 @@ { "allValue": ".+", "current": { - "selected": false, + "selected": true, "text": [ - "static:mysql.sample-apps.svc.cluster.local:3306" + "All" ], "value": [ - "static:mysql.sample-apps.svc.cluster.local:3306" + "$__all" ] }, "datasource": { "uid": "$datasource" }, - "definition": "label_values(mysql_up, instance)", + "definition": "label_values(mysql_up{job=~\"$job\"},instance)", "hide": 0, "includeAll": true, "label": "instance", "multi": true, "name": "instance", "options": [], - "query": "label_values(mysql_up, instance)", + "query": "label_values(mysql_up{job=~\"$job\"},instance)", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -4148,4 +4149,4 @@ "uid": "549c2bf8936f7767ea6ac47c47b00f2a", "version": 10, "weekStart": "" -} \ No newline at end of file +} From 322cb9f9159ac285514111b1df514d9d743097f7 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Fri, 21 Jun 2024 00:46:48 +0500 Subject: [PATCH 04/12] Fix confict - save changes --- mysqld-mixin/dashboards/mysql-overview.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mysqld-mixin/dashboards/mysql-overview.json b/mysqld-mixin/dashboards/mysql-overview.json index 4a680a20..f14f38ae 100644 --- a/mysqld-mixin/dashboards/mysql-overview.json +++ b/mysqld-mixin/dashboards/mysql-overview.json @@ -4097,13 +4097,8 @@ "multi": true, "name": "instance", "options": [], -<<<<<<< HEAD "query": "label_values(mysql_up{job=~\"$job\"},instance)", "refresh": 1, -======= - "query": "label_values(mysql_up, instance)", - "refresh": 2, ->>>>>>> master "regex": "", "skipUrlSync": false, "sort": 0, From 2b5d6dd28c228da5fd056d01eeaf756cc5b3d6f3 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Fri, 21 Jun 2024 04:29:44 +0500 Subject: [PATCH 05/12] Add more alerts --- mysqld-mixin/alerts/galera.yaml | 6 ++++ mysqld-mixin/alerts/general.yaml | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/mysqld-mixin/alerts/galera.yaml b/mysqld-mixin/alerts/galera.yaml index 31016b5f..51521a08 100644 --- a/mysqld-mixin/alerts/galera.yaml +++ b/mysqld-mixin/alerts/galera.yaml @@ -72,3 +72,9 @@ groups: description: The innodb logs are waiting for disk at a rate of {{$value}} / second summary: MySQL innodb log writes stalling. + - alert: MysqlSlaveBehindMaster + expr: rate(mysql_slave_status_seconds_behind_master{asserts_env!=""}[5m]) > 30 + labels: + asserts_severity: warning + asserts_entity_type: Service + asserts_alert_category: failure diff --git a/mysqld-mixin/alerts/general.yaml b/mysqld-mixin/alerts/general.yaml index b4d8bf9e..b3191051 100644 --- a/mysqld-mixin/alerts/general.yaml +++ b/mysqld-mixin/alerts/general.yaml @@ -9,3 +9,51 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} is not up.' summary: MySQL not up. + - alert: MysqlRestarted + expr: mysql_global_status_uptime < 60 + labels: + severity: critical + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} restarted less than a minute ago.' + summary: MySQL restarted. + - alert: MysqlSlowQueries + expr: rate(mysql_global_status_slow_queries[5m]) * 60 > 0 + for: 2m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} is facing slow queries.' + summary: MySQL slow queries. + - alert: TuneThreadCacheSize + expr: mysql_global_status_threads_created / mysql_global_status_connections > 0.5 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} thread cache needs tuning.' + summary: MySQL thread cache needs tuning. + - alert: InsufficientTempTableSize + expr: mysql_global_status_created_tmp_disk_tables / mysql_global_status_created_tmp_tables > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient temp table size.' + summary: MySQL temp table size insufficient. + - alert: InsufficientBinLogCacheSize + expr: mysql_global_status_binlog_cache_disk_use / mysql_global_status_binlog_cache_use > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log cache size.' + summary: MySQL binary log cache size insufficient. + - alert: InsufficientBinLogStmtCacheSize + expr: mysql_global_status_binlog_stmt_cache_disk_use{ / mysql_global_status_binlog_stmt_cache_use > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log statement cache size.' + summary: MySQL binary log statement cache size insufficient. + From 1e578f9761ccda863eecb2d32a4bc4ecbe45a60a Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Fri, 21 Jun 2024 04:38:43 +0500 Subject: [PATCH 06/12] Fix alerts --- mysqld-mixin/alerts/galera.yaml | 9 +++++---- mysqld-mixin/alerts/general.yaml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mysqld-mixin/alerts/galera.yaml b/mysqld-mixin/alerts/galera.yaml index 51521a08..e5122aee 100644 --- a/mysqld-mixin/alerts/galera.yaml +++ b/mysqld-mixin/alerts/galera.yaml @@ -73,8 +73,9 @@ groups: second summary: MySQL innodb log writes stalling. - alert: MysqlSlaveBehindMaster - expr: rate(mysql_slave_status_seconds_behind_master{asserts_env!=""}[5m]) > 30 + expr: rate(mysql_slave_status_seconds_behind_master[5m]) > 30 labels: - asserts_severity: warning - asserts_entity_type: Service - asserts_alert_category: failure + severity: warning + annotations: + description: MySQL slave on {{$labels.instance}} is behind master by more than 30 seconds. + summary: MySQL innodb slave behind master. diff --git a/mysqld-mixin/alerts/general.yaml b/mysqld-mixin/alerts/general.yaml index b3191051..2bea2394 100644 --- a/mysqld-mixin/alerts/general.yaml +++ b/mysqld-mixin/alerts/general.yaml @@ -49,7 +49,7 @@ groups: description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log cache size.' summary: MySQL binary log cache size insufficient. - alert: InsufficientBinLogStmtCacheSize - expr: mysql_global_status_binlog_stmt_cache_disk_use{ / mysql_global_status_binlog_stmt_cache_use > 0.2 + expr: mysql_global_status_binlog_stmt_cache_disk_use / mysql_global_status_binlog_stmt_cache_use > 0.2 for: 5m labels: severity: warning From 0f1aac707ea6d1e9d27831cd193c69f0d5a9cdec Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Fri, 21 Jun 2024 04:58:12 +0500 Subject: [PATCH 07/12] Combine alerts in one group --- .../alerts/{galera.yaml => alerts.yaml} | 68 ++++++++++++++++--- mysqld-mixin/alerts/general.yaml | 59 ---------------- 2 files changed, 57 insertions(+), 70 deletions(-) rename mysqld-mixin/alerts/{galera.yaml => alerts.yaml} (54%) delete mode 100644 mysqld-mixin/alerts/general.yaml diff --git a/mysqld-mixin/alerts/galera.yaml b/mysqld-mixin/alerts/alerts.yaml similarity index 54% rename from mysqld-mixin/alerts/galera.yaml rename to mysqld-mixin/alerts/alerts.yaml index e5122aee..1bbd726b 100644 --- a/mysqld-mixin/alerts/galera.yaml +++ b/mysqld-mixin/alerts/alerts.yaml @@ -1,14 +1,61 @@ -### -# Sample prometheus rules/alerts for mysqld. -# -# NOTE: Please review these carefully as thresholds and behavior may not meet -# your SLOs or labels. -# -### - groups: -- name: GaleraAlerts +- name: MySQLAlerts rules: + - alert: MySQLDown + expr: mysql_up != 1 + for: 5m + labels: + severity: critical + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} is not up.' + summary: MySQL not up. + - alert: MysqlRestarted + expr: mysql_global_status_uptime < 60 + labels: + severity: critical + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} restarted less than a minute ago.' + summary: MySQL restarted. + - alert: MysqlSlowQueries + expr: rate(mysql_global_status_slow_queries[5m]) * 60 > 0 + for: 2m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} is facing slow queries.' + summary: MySQL slow queries. + - alert: TuneThreadCacheSize + expr: mysql_global_status_threads_created / mysql_global_status_connections > 0.5 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} thread cache needs tuning.' + summary: MySQL thread cache needs tuning. + - alert: InsufficientTempTableSize + expr: mysql_global_status_created_tmp_disk_tables / mysql_global_status_created_tmp_tables > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient temp table size.' + summary: MySQL temp table size insufficient. + - alert: InsufficientBinLogCacheSize + expr: mysql_global_status_binlog_cache_disk_use / mysql_global_status_binlog_cache_use > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log cache size.' + summary: MySQL binary log cache size insufficient. + - alert: InsufficientBinLogStmtCacheSize + expr: mysql_global_status_binlog_stmt_cache_disk_use / mysql_global_status_binlog_stmt_cache_use > 0.2 + for: 5m + labels: + severity: warning + annotations: + description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log statement cache size.' + summary: MySQL binary log statement cache size insufficient. - alert: MySQLGaleraNotReady expr: mysql_global_status_wsrep_ready != 1 for: 5m @@ -28,8 +75,7 @@ groups: != 4).' summary: Galera cluster node out of sync. - alert: MySQLGaleraDonorFallingBehind - expr: (mysql_global_status_wsrep_local_state == 2 and mysql_global_status_wsrep_local_recv_queue - > 100) + expr: (mysql_global_status_wsrep_local_state == 2 and mysql_global_status_wsrep_local_recv_queue > 100) for: 5m labels: severity: warning diff --git a/mysqld-mixin/alerts/general.yaml b/mysqld-mixin/alerts/general.yaml deleted file mode 100644 index 2bea2394..00000000 --- a/mysqld-mixin/alerts/general.yaml +++ /dev/null @@ -1,59 +0,0 @@ -groups: -- name: MySQLdAlerts - rules: - - alert: MySQLDown - expr: mysql_up != 1 - for: 5m - labels: - severity: critical - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} is not up.' - summary: MySQL not up. - - alert: MysqlRestarted - expr: mysql_global_status_uptime < 60 - labels: - severity: critical - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} restarted less than a minute ago.' - summary: MySQL restarted. - - alert: MysqlSlowQueries - expr: rate(mysql_global_status_slow_queries[5m]) * 60 > 0 - for: 2m - labels: - severity: warning - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} is facing slow queries.' - summary: MySQL slow queries. - - alert: TuneThreadCacheSize - expr: mysql_global_status_threads_created / mysql_global_status_connections > 0.5 - for: 5m - labels: - severity: warning - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} thread cache needs tuning.' - summary: MySQL thread cache needs tuning. - - alert: InsufficientTempTableSize - expr: mysql_global_status_created_tmp_disk_tables / mysql_global_status_created_tmp_tables > 0.2 - for: 5m - labels: - severity: warning - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient temp table size.' - summary: MySQL temp table size insufficient. - - alert: InsufficientBinLogCacheSize - expr: mysql_global_status_binlog_cache_disk_use / mysql_global_status_binlog_cache_use > 0.2 - for: 5m - labels: - severity: warning - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log cache size.' - summary: MySQL binary log cache size insufficient. - - alert: InsufficientBinLogStmtCacheSize - expr: mysql_global_status_binlog_stmt_cache_disk_use / mysql_global_status_binlog_stmt_cache_use > 0.2 - for: 5m - labels: - severity: warning - annotations: - description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log statement cache size.' - summary: MySQL binary log statement cache size insufficient. - From 5ea04013cc16adcc4eff42ae14449abe1e29fa7f Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Fri, 21 Jun 2024 04:59:41 +0500 Subject: [PATCH 08/12] Combine alerts in one group --- mysqld-mixin/mixin.libsonnet | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysqld-mixin/mixin.libsonnet b/mysqld-mixin/mixin.libsonnet index 9515cdea..1472434f 100644 --- a/mysqld-mixin/mixin.libsonnet +++ b/mysqld-mixin/mixin.libsonnet @@ -12,6 +12,5 @@ prometheusRules+: importRules(importstr 'rules/rules.yaml'), prometheusAlerts+: - importRules(importstr 'alerts/general.yaml') + - importRules(importstr 'alerts/galera.yaml'), + importRules(importstr 'alerts/alerts.yaml') } From d4f0fac7b04e14fd12b5c456aff6a08a07a949e8 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Mon, 1 Jul 2024 17:13:44 +0500 Subject: [PATCH 09/12] Fix case of MySQL and prefix MySQL with all alerts --- mysqld-mixin/alerts/alerts.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysqld-mixin/alerts/alerts.yaml b/mysqld-mixin/alerts/alerts.yaml index 1bbd726b..8dab2045 100644 --- a/mysqld-mixin/alerts/alerts.yaml +++ b/mysqld-mixin/alerts/alerts.yaml @@ -9,14 +9,14 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} is not up.' summary: MySQL not up. - - alert: MysqlRestarted + - alert: MySQLRestarted expr: mysql_global_status_uptime < 60 labels: severity: critical annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} restarted less than a minute ago.' summary: MySQL restarted. - - alert: MysqlSlowQueries + - alert: MySQLSlowQueries expr: rate(mysql_global_status_slow_queries[5m]) * 60 > 0 for: 2m labels: @@ -40,7 +40,7 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient temp table size.' summary: MySQL temp table size insufficient. - - alert: InsufficientBinLogCacheSize + - alert: MySQLInsufficientBinLogCacheSize expr: mysql_global_status_binlog_cache_disk_use / mysql_global_status_binlog_cache_use > 0.2 for: 5m labels: @@ -48,7 +48,7 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} has insufficient binary log cache size.' summary: MySQL binary log cache size insufficient. - - alert: InsufficientBinLogStmtCacheSize + - alert: MySQLInsufficientBinLogStmtCacheSize expr: mysql_global_status_binlog_stmt_cache_disk_use / mysql_global_status_binlog_stmt_cache_use > 0.2 for: 5m labels: @@ -118,7 +118,7 @@ groups: description: The innodb logs are waiting for disk at a rate of {{$value}} / second summary: MySQL innodb log writes stalling. - - alert: MysqlSlaveBehindMaster + - alert: MySQLSlaveBehindMaster expr: rate(mysql_slave_status_seconds_behind_master[5m]) > 30 labels: severity: warning From fb83349f76beef827483ee5568f8737ff2274300 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Mon, 1 Jul 2024 17:17:17 +0500 Subject: [PATCH 10/12] Prefix MySQL with all alerts --- mysqld-mixin/alerts/alerts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqld-mixin/alerts/alerts.yaml b/mysqld-mixin/alerts/alerts.yaml index 8dab2045..47796034 100644 --- a/mysqld-mixin/alerts/alerts.yaml +++ b/mysqld-mixin/alerts/alerts.yaml @@ -24,7 +24,7 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} is facing slow queries.' summary: MySQL slow queries. - - alert: TuneThreadCacheSize + - alert: MySQLTuneThreadCacheSize expr: mysql_global_status_threads_created / mysql_global_status_connections > 0.5 for: 5m labels: From 7a5b777a7c283e633b371c4b819382947a0c59c9 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Mon, 1 Jul 2024 17:30:42 +0500 Subject: [PATCH 11/12] Add missing MySQL prefix --- mysqld-mixin/alerts/alerts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqld-mixin/alerts/alerts.yaml b/mysqld-mixin/alerts/alerts.yaml index 47796034..dff67aeb 100644 --- a/mysqld-mixin/alerts/alerts.yaml +++ b/mysqld-mixin/alerts/alerts.yaml @@ -32,7 +32,7 @@ groups: annotations: description: 'MySQL {{$labels.job}} on {{$labels.instance}} thread cache needs tuning.' summary: MySQL thread cache needs tuning. - - alert: InsufficientTempTableSize + - alert: MySQLInsufficientTempTableSize expr: mysql_global_status_created_tmp_disk_tables / mysql_global_status_created_tmp_tables > 0.2 for: 5m labels: From 2589f46354b78a5e2c6d7a71abc4012beefc95ac Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Thu, 4 Jul 2024 23:09:38 +0500 Subject: [PATCH 12/12] Set instance variable to refresh on time range --- mysqld-mixin/dashboards/mysql-overview.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqld-mixin/dashboards/mysql-overview.json b/mysqld-mixin/dashboards/mysql-overview.json index f14f38ae..fc39aedd 100644 --- a/mysqld-mixin/dashboards/mysql-overview.json +++ b/mysqld-mixin/dashboards/mysql-overview.json @@ -4098,7 +4098,7 @@ "name": "instance", "options": [], "query": "label_values(mysql_up{job=~\"$job\"},instance)", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 0,