From cce5f91927f6889d9a32ad6e5371349d5af17973 Mon Sep 17 00:00:00 2001 From: durant <826035498@qq.com> Date: Wed, 27 Nov 2024 16:04:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(backend):=20=E5=8D=87=E7=BA=A7=20grafana?= =?UTF-8?q?=20=E7=89=88=E6=9C=AC=20#8222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboards/json/mongoreplicaset.json | 14 +- .../dashboards/json/mongoshardedcluster.json | 44 +- .../dashboards/json/tendbcluster.json | 1445 +++++----- .../bk_dataview/dashboards/json/tendbha.json | 2488 ++++++++++------- .../backend/bk_dataview/dashboards/readme.md | 16 +- .../bk_dataview/grafana/provisioning.py | 111 +- helm-charts/bk-dbm/values.yaml | 2 +- 7 files changed, 2386 insertions(+), 1734 deletions(-) diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/mongoreplicaset.json b/dbm-ui/backend/bk_dataview/dashboards/json/mongoreplicaset.json index 7e34fbe9e6..3e61569e06 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/mongoreplicaset.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/mongoreplicaset.json @@ -2050,7 +2050,7 @@ "uid": "dba_mongo_proxy" }, "description": "This can show a correlation with the replication lag value", - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2168,7 +2168,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2287,7 +2287,7 @@ "uid": "dba_mongo_proxy" }, "description": "Elections happen when a primary becomes unavailable. Look at this graph over longer periods (weeks or months) to determine patterns and correlate elections with other events.", - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2403,7 +2403,7 @@ "uid": "dba_mongo_proxy" }, "description": "Shows the heartbeat return times sent by the current member to other members in the replica set.", - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2522,7 +2522,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2651,7 +2651,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2768,7 +2768,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/mongoshardedcluster.json b/dbm-ui/backend/bk_dataview/dashboards/json/mongoshardedcluster.json index 2c8a81f956..f681c5824b 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/mongoshardedcluster.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/mongoshardedcluster.json @@ -1749,7 +1749,7 @@ "uid": "dba_mongo_proxy" }, "description": "mongodb datasize du -sk $datadir of one member", - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2335,7 +2335,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2470,7 +2470,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2605,7 +2605,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2738,7 +2738,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2859,7 +2859,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -2967,7 +2967,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3106,7 +3106,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3232,7 +3232,7 @@ "uid": "dba_mongo_proxy" }, "description": "increase $interval mongodb_mongod_connections_metrics_created_total", - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3342,7 +3342,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3449,7 +3449,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3582,7 +3582,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3715,7 +3715,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3862,7 +3862,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -3969,7 +3969,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -4074,7 +4074,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -4179,7 +4179,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -4288,7 +4288,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": { @@ -4770,7 +4770,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": {}, @@ -4873,7 +4873,7 @@ "uid": "dba_mongo_proxy" }, "decimals": 0, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": {}, @@ -4975,7 +4975,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": {}, @@ -5078,7 +5078,7 @@ "datasource": { "uid": "dba_mongo_proxy" }, - "editable": true, + "editable": false, "error": false, "fieldConfig": { "defaults": {}, diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json index 7477176346..c48a093705 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json @@ -21,10 +21,10 @@ } ] }, - "editable": false, + "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, + "id": 29949, "links": [], "liveNow": false, "panels": [ @@ -36,7 +36,7 @@ "x": 0, "y": 0 }, - "id": null, + "id": 22, "panels": [], "title": "Summary", "type": "row" @@ -44,7 +44,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -53,7 +53,9 @@ }, "custom": { "align": "auto", - "displayMode": "auto", + "cellOptions": { + "type": "auto" + }, "inspect": false }, "mappings": [], @@ -93,10 +95,12 @@ "y": 1 }, "hideTimeOverride": true, - "id": null, + "id": 10, "interval": "6h", "options": { + "cellHeight": "sm", "footer": { + "countRows": false, "fields": "", "reducer": [ "sum" @@ -106,13 +110,13 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "table", @@ -178,7 +182,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -210,9 +214,11 @@ "y": 1 }, "hideTimeOverride": true, - "id": null, - "interval": "6h", + "id": 14, + "interval": "2h", "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -223,9 +229,10 @@ "values": false }, "showThresholdLabels": false, - "showThresholdMarkers": true + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -289,7 +296,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -321,9 +328,11 @@ "y": 1 }, "hideTimeOverride": true, - "id": null, + "id": 111, "interval": "2h", "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -333,9 +342,10 @@ "values": false }, "showThresholdLabels": false, - "showThresholdMarkers": true + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -343,6 +353,7 @@ "type": "bkmonitor-timeseries-datasource", "uid": "HVlyYOe4z" }, + "enableDownSampling": true, "expressionList": [], "format": "time_series", "host": [], @@ -361,7 +372,7 @@ "group_by": [ "cluster_domain" ], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "SUM", "metric_field": "mysql_datadir_du_used_mb", @@ -401,7 +412,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -410,6 +421,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -423,6 +435,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -462,7 +475,7 @@ "x": 16, "y": 1 }, - "id": null, + "id": 55, "options": { "legend": { "calcs": [], @@ -538,7 +551,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -547,6 +560,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -560,6 +574,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -600,7 +615,7 @@ "x": 0, "y": 7 }, - "id": null, + "id": 33, "options": { "legend": { "calcs": [ @@ -723,7 +738,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -731,6 +746,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -744,6 +760,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -783,7 +800,7 @@ "x": 8, "y": 7 }, - "id": null, + "id": 32, "interval": "1m", "options": { "legend": { @@ -873,7 +890,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -881,6 +898,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -894,6 +912,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -934,7 +953,7 @@ "x": 16, "y": 7 }, - "id": null, + "id": 73, "interval": "1m", "options": { "legend": { @@ -1016,7 +1035,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1024,6 +1043,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1037,6 +1057,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1076,7 +1097,7 @@ "x": 0, "y": 15 }, - "id": null, + "id": 26, "options": { "legend": { "calcs": [ @@ -1178,6 +1199,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1191,6 +1213,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1230,7 +1253,7 @@ "x": 6, "y": 15 }, - "id": null, + "id": 25, "options": { "legend": { "calcs": [ @@ -1319,7 +1342,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1327,6 +1350,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1340,6 +1364,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1381,7 +1406,7 @@ "x": 12, "y": 15 }, - "id": null, + "id": 31, "options": { "legend": { "calcs": [ @@ -1402,7 +1427,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [ { @@ -1567,7 +1592,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1575,6 +1600,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1588,6 +1614,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1628,7 +1655,7 @@ "x": 17, "y": 15 }, - "id": null, + "id": 83, "options": { "legend": { "calcs": [], @@ -1704,12 +1731,12 @@ "x": 0, "y": 23 }, - "id": null, + "id": 92, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "Click link to get details for this instance", "fieldConfig": { @@ -1719,7 +1746,9 @@ }, "custom": { "align": "auto", - "displayMode": "auto", + "cellOptions": { + "type": "auto" + }, "filterable": true, "inspect": false }, @@ -1771,13 +1800,15 @@ { "targetBlank": true, "title": "Show details", - "url": "{BK_SAAS_HOST}/grafana/d/Gq771PmIk/mysql-instance?orgId=4945&var-app=$app&var-cluster_domain=$cluster_domain&var-instance=${__value.raw}" + "url": "{BK_SAAS_HOST}/grafana/d/Gq771PmIk/mysql-instance?orgId=1&var-app=$app&var-cluster_domain=$cluster_domain&var-instance=${__value.raw}" } ] }, { - "id": "custom.displayMode", - "value": "color-text" + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } } ] }, @@ -1801,7 +1832,7 @@ "x": 0, "y": 2 }, - "id": null, + "id": 13, "interval": "6h", "links": [], "options": { @@ -1894,7 +1925,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { @@ -1954,7 +1985,7 @@ "x": 12, "y": 2 }, - "id": null, + "id": 96, "options": { "legend": { "calcs": [ @@ -2071,7 +2102,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { @@ -2132,7 +2163,7 @@ "x": 12, "y": 7 }, - "id": null, + "id": 114, "options": { "legend": { "calcs": [ @@ -2153,7 +2184,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -2213,7 +2244,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "The number of statements executed by the server. This includes\nonly statements sent to the server by clients and not statements executed\nwithin stored programs, unlike the Queries variable. This variable does\nnot count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or\nCOM_STMT_RESET commands", "fieldConfig": { @@ -2273,7 +2304,7 @@ "x": 0, "y": 12 }, - "id": null, + "id": 95, "options": { "legend": { "calcs": [ @@ -2364,7 +2395,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -2425,7 +2456,7 @@ "x": 12, "y": 12 }, - "id": null, + "id": 89, "options": { "legend": { "calcs": [ @@ -2547,7 +2578,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -2606,7 +2637,7 @@ "x": 0, "y": 17 }, - "id": null, + "id": 105, "options": { "legend": { "calcs": [], @@ -2701,7 +2732,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "The number of statements executed by the server. This variable\nincludes statements executed within stored programs, unlike the Questions\nvariable. It does not count COM_PING or COM_STATISTICS commands", "fieldConfig": { @@ -2761,7 +2792,7 @@ "x": 12, "y": 17 }, - "id": null, + "id": 98, "options": { "legend": { "calcs": [ @@ -2852,7 +2883,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -2912,7 +2943,7 @@ "x": 0, "y": 22 }, - "id": null, + "id": 87, "options": { "legend": { "calcs": [], @@ -2983,7 +3014,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -3043,7 +3074,7 @@ "x": 6, "y": 22 }, - "id": null, + "id": 80, "options": { "legend": { "calcs": [], @@ -3141,7 +3172,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3202,7 +3233,7 @@ "x": 12, "y": 22 }, - "id": null, + "id": 101, "options": { "legend": { "calcs": [ @@ -3293,7 +3324,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3353,7 +3384,7 @@ "x": 18, "y": 22 }, - "id": null, + "id": 99, "options": { "legend": { "calcs": [ @@ -3444,7 +3475,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3505,7 +3536,7 @@ "x": 0, "y": 27 }, - "id": null, + "id": 56, "options": { "legend": { "calcs": [ @@ -3656,12 +3687,12 @@ "x": 0, "y": 24 }, - "id": null, + "id": 113, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3721,7 +3752,7 @@ "x": 0, "y": 3 }, - "id": null, + "id": 94, "options": { "legend": { "calcs": [], @@ -3799,7 +3830,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3859,7 +3890,7 @@ "x": 12, "y": 3 }, - "id": null, + "id": 115, "options": { "legend": { "calcs": [], @@ -3937,7 +3968,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -3997,7 +4028,7 @@ "x": 0, "y": 8 }, - "id": null, + "id": 11, "options": { "legend": { "calcs": [], @@ -4076,7 +4107,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4137,7 +4168,7 @@ "x": 12, "y": 8 }, - "id": null, + "id": 77, "options": { "legend": { "calcs": [], @@ -4279,7 +4310,7 @@ } ], "refId": "C", - "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source": "max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step": "", "type": "range" } @@ -4290,7 +4321,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -4350,7 +4381,7 @@ "x": 0, "y": 13 }, - "id": null, + "id": 93, "interval": "1h", "options": { "legend": { @@ -4430,7 +4461,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4491,7 +4522,7 @@ "x": 12, "y": 13 }, - "id": null, + "id": 97, "options": { "legend": { "calcs": [], @@ -4594,7 +4625,7 @@ } ], "refId": "C", - "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source": "max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step": "", "type": "range" } @@ -4606,7 +4637,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -4669,7 +4700,7 @@ "x": 0, "y": 18 }, - "id": null, + "id": 104, "interval": "2h", "options": { "legend": { @@ -4748,7 +4779,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4809,7 +4840,7 @@ "x": 0, "y": 23 }, - "id": null, + "id": 53, "options": { "legend": { "calcs": [], @@ -4930,7 +4961,7 @@ } ], "refId": "C", - "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source": "max(max_over_time(bkmonitor:system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step": "", "type": "range" } @@ -4943,622 +4974,723 @@ "type": "row" }, { - "collapsed": true, + "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 25 }, - "id": null, - "panels": [ - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "id": 70, + "panels": [], + "title": "Table Capacity", + "type": "row" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "fieldConfig": { - "defaults": { - "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": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 24 - }, - "id": null, - "interval": "24h", - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "tooltip": { - "mode": "multi", - "sort": "desc" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 102, + "interval": "24h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ { - "alias": "$tag_database_name", - "data_label": "dbm_report_channel", - "data_source_label": "custom", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "database_name" + "key": "cnk9lk1197", + "list": [ + { + "id": "cluster_domain", + "name": "cluster_domain" + } ], - "interval": "auto", - "interval_unit": "s", - "method": "SUM", - "metric_field": "mysql_database_size", - "refId": "a", - "result_table_id": "bkmonitor_time_series_553410.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ + "open": false, + "type": "key", + "value": "cluster_domain" + }, + { + "key": "zsx1ipg79c", + "list": [ { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "id": "is", + "name": "is" }, { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "slave" - ] + "id": "is one of", + "name": "is one of" + }, + { + "id": "is not", + "name": "is not" + }, + { + "id": "is not one of", + "name": "is not one of" + }, + { + "id": "gt", + "name": ">" + }, + { + "id": "gte", + "name": ">=" + }, + { + "id": "lt", + "name": "<" + }, + { + "id": "lte", + "name": "<=" } + ], + "type": "method", + "value": "is" + }, + { + "key": "cbs6j1tni2", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" ] } + ] + ], + "dimensions": [ + "database_name" + ], + "index": { + "id": [ + "host_process", + 16118 ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + "labels": [ + "进程", + "[采集项]mysql_db_table_size" + ] + }, + "indexSetString": "", + "method": "sum", + "metric": "database_size", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ], - "timeFrom": "7d", - "title": "Database Size (ibd)", - "type": "timeseries" - }, - { + }, "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" }, - "fieldConfig": { - "defaults": { - "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": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 24 + "refId": "A" + } + ], + "timeFrom": "7d", + "title": "Database Size (ibd)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "id": null, - "interval": "24", - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "tooltip": { - "mode": "multi", - "sort": "desc" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 26 + }, + "id": 103, + "interval": "24h", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "data": { + "alias": "$tag_database_name $tag_table_name", + "conditions": [ + [ { - "alias": "$tag_database_name.$tag_table_name", - "data_label": "dbm_report_channel", - "data_source_label": "custom", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ + "key": "jfl32mnkh7", + "list": [ { - "id": "topk", - "params": [ - { - "id": "k", - "value": "30" - } - ] + "id": "cluster_domain", + "name": "cluster_domain" } ], - "group_by": [ - "database_name", - "table_name" - ], - "interval": "auto", - "interval_unit": "s", - "method": "SUM", - "metric_field": "mysql_table_size", - "refId": "a", - "result_table_id": "bkmonitor_time_series_553410.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ + "open": false, + "type": "key", + "value": "cluster_domain" + }, + { + "key": "l8di2u7rgc", + "list": [ { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] + "id": "is", + "name": "is" + }, + { + "id": "is one of", + "name": "is one of" + }, + { + "id": "is not", + "name": "is not" + }, + { + "id": "is not one of", + "name": "is not one of" + }, + { + "id": "gt", + "name": ">" + }, + { + "id": "gte", + "name": ">=" + }, + { + "id": "lt", + "name": "<" + }, + { + "id": "lte", + "name": "<=" } + ], + "type": "method", + "value": "is" + }, + { + "key": "n1p5rz06ia", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" ] } + ] + ], + "dimensions": [ + "database_name", + "table_name" + ], + "index": { + "id": [ + "host_process", + 16118 ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + "labels": [ + "进程", + "[采集项]mysql_db_table_size" + ] + }, + "indexSetString": "", + "method": "sum", + "metric": "table_size", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ], - "timeFrom": "7d", - "title": "Table Size Top30(ibd)", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" }, - "fieldConfig": { - "defaults": { - "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", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "mbytes" - }, - "overrides": [] + "datasource": { + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 32 + "refId": "A" + } + ], + "timeFrom": "7d", + "title": "Table Size Top30(ibd)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "id": null, - "interval": "24h", - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "tooltip": { - "mode": "multi", - "sort": "desc" + "insertNulls": false, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "targets": [ - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 65, + "interval": "2h", + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "HVlyYOe4z" + }, + "enableDownSampling": true, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_instance,$tag_path", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "path", + "instance" + ], + "interval": 7200, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_du_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ { - "alias": "$tag_instance,$tag_path", - "data_label": "exporter_dbm_mysqld_exporter", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "path", - "instance" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_datadir_du_used_mb", - "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "remote_master" - ] - } + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "remote_master" ] } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + ] } ], - "title": "datadir Size by Shard Instance", - "type": "timeseries" + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "timeFrom": "7d", + "title": "datadir Size by Shard Instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 34 + }, + "id": 84, + "interval": "2h", + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ { + "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "HVlyYOe4z" }, - "fieldConfig": { - "defaults": { - "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": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "enableDownSampling": true, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "used $tag_instance_host $tag_mount_point", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point", + "instance_host" + ], + "interval": 7200, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_df_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] }, - "thresholdsStyle": { - "mode": "off" + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "remote_master" + ] } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "mbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 32 - }, - "id": null, - "interval": "2h", - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + ] }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ + "alias": "total $tag_instance_host $tag_mount_point", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point", + "instance_host" + ], + "interval": 7200, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_datadir_df_total_mb", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ { - "alias": "used $tag_instance_host $tag_mount_point", - "data_label": "exporter_dbm_mysqld_exporter", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "mount_point", - "instance_host" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_datadir_df_used_mb", - "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "remote_master" - ] - } + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" ] }, { - "alias": "total $tag_instance_host $tag_mount_point", - "data_label": "exporter_dbm_mysqld_exporter", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "mount_point", - "instance_host" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_datadir_df_total_mb", - "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "remote_master" - ] - } + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "remote_master" ] } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + ] } ], - "title": "disk partition space by host", - "type": "timeseries" + "refId": "A", + "source": "", + "step": "", + "type": "range" } ], - "title": "Table Capacity", - "type": "row" + "timeFrom": "7d", + "title": "disk partition space by host", + "type": "timeseries" }, { "collapsed": true, @@ -5566,14 +5698,14 @@ "h": 1, "w": 24, "x": 0, - "y": 26 + "y": 41 }, - "id": null, + "id": 120, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "The number of statements executed by the server. This includes\nonly statements sent to the server by clients and not statements executed\nwithin stored programs, unlike the Queries variable. This variable does\nnot count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or\nCOM_STMT_RESET commands", "fieldConfig": { @@ -5634,7 +5766,7 @@ "x": 0, "y": 22 }, - "id": null, + "id": 121, "options": { "legend": { "calcs": [ @@ -5717,7 +5849,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -5777,7 +5909,7 @@ "x": 12, "y": 22 }, - "id": null, + "id": 122, "options": { "legend": { "calcs": [ @@ -5850,7 +5982,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { @@ -5910,7 +6042,7 @@ "x": 0, "y": 28 }, - "id": null, + "id": 123, "options": { "legend": { "calcs": [ @@ -5930,7 +6062,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -5983,7 +6115,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -6006,7 +6138,7 @@ "x": 0, "y": 33 }, - "id": null, + "id": 116, "interval": "1m", "options": { "calculate": false, @@ -6046,7 +6178,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -6107,7 +6239,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -6130,7 +6262,7 @@ "x": 12, "y": 33 }, - "id": null, + "id": 117, "interval": "1m", "options": { "calculate": false, @@ -6170,7 +6302,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -6231,7 +6363,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -6254,7 +6386,7 @@ "x": 0, "y": 43 }, - "id": null, + "id": 118, "interval": "1m", "options": { "calculate": false, @@ -6294,7 +6426,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -6358,8 +6490,7 @@ } ], "refresh": false, - "schemaVersion": 37, - "style": "dark", + "schemaVersion": 39, "tags": [ "tendbcluster" ], @@ -6373,10 +6504,10 @@ }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", - "hide": 2, + "hide": 0, "includeAll": false, "label": "app", "multi": false, @@ -6405,12 +6536,12 @@ { "current": { "selected": false, - "text": "", - "value": "" + "text": "spider.cailin.dbatest.db", + "value": "spider.cailin.dbatest.db" }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -6508,7 +6639,7 @@ }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", "hide": 2, @@ -6563,6 +6694,6 @@ "timezone": "default", "title": "TenDBCluster", "uid": "8303483841", - "version": 15, + "version": 18, "weekStart": "" } diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json index a7ccee0241..bc8ed03e82 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json @@ -21,10 +21,10 @@ } ] }, - "editable": false, + "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, + "id": 29813, "links": [], "liveNow": false, "panels": [ @@ -36,7 +36,7 @@ "x": 0, "y": 0 }, - "id": null, + "id": 22, "panels": [], "title": "Summary ($dbrole)", "type": "row" @@ -44,7 +44,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -76,9 +76,11 @@ "y": 1 }, "hideTimeOverride": true, - "id": null, + "id": 14, "interval": "1h", "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -88,16 +90,18 @@ "values": false }, "showThresholdLabels": false, - "showThresholdMarkers": true + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, + "enableDownSampling": true, "expressionList": [], "format": "time_series", "host": [], @@ -114,7 +118,7 @@ "filter_dict": {}, "functions": [], "group_by": [], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "MAX", "metric_field": "mysql_datadir_df_usage", @@ -154,7 +158,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -163,6 +167,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -176,6 +181,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -215,7 +221,7 @@ "x": 3, "y": 1 }, - "id": null, + "id": 55, "options": { "legend": { "calcs": [], @@ -285,21 +291,22 @@ "type": "range" } ], - "title": "CPU Usage", + "title": "Backend CPU Usage", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "select|insert|update|delete|replace|commit", + "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -313,6 +320,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -342,8 +350,7 @@ "value": 80 } ] - }, - "unit": "ops" + } }, "overrides": [] }, @@ -353,15 +360,12 @@ "x": 9, "y": 1 }, - "id": null, + "id": 99, "options": { "legend": { - "calcs": [ - "last", - "max" - ], + "calcs": [], "displayMode": "table", - "placement": "right", + "placement": "bottom", "showLegend": true }, "tooltip": { @@ -369,6 +373,7 @@ "sort": "desc" } }, + "pluginVersion": "9.1.0", "targets": [ { "cluster": [], @@ -380,9 +385,9 @@ "format": "time_series", "hide": false, "host": [], - "mode": "code", + "mode": "ui", "module": [], - "promqlAlias": "$tag_command", + "promqlAlias": "", "query_configs": [ { "alias": "", @@ -390,28 +395,18 @@ "data_type_label": "time_series", "display": true, "filter_dict": {}, - "functions": [ - { - "id": "rate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], + "functions": [], "group_by": [ - "command" + "bk_target_ip" ], - "interval": 60, + "interval": "auto", "interval_unit": "s", "method": "AVG", - "metric_field": "mysql_global_status_commands_total", + "metric_field": "usage", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "", + "result_table_id": "dbm_system.cpu_summary", + "result_table_label": "os", + "time_field": "time", "where": [ { "key": "cluster_domain", @@ -425,57 +420,25 @@ "key": "instance_role", "method": "eq", "value": [ - "$dbrole" - ] - }, - { - "condition": "and", - "key": "command", - "method": "reg", - "value": [ - "select|insert|update|delete" + "proxy" ] } ] } ], - "refId": "B", - "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit\",instance_role=\"$dbrole\"}[2m])) >0", + "refId": "C", + "source": "", "step": "", "type": "range" } ], - "title": "QPS", - "transformations": [ - { - "id": "calculateField", - "options": { - "mode": "reduceRow", - "reduce": { - "include": [ - "commit", - "delete", - "delete_multi", - "insert", - "insert_select", - "replace", - "replace_select", - "select", - "update", - "update_multi", - "xa_commit" - ], - "reducer": "sum" - } - } - } - ], + "title": "Proxy CPU Usage", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -484,6 +447,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -497,6 +461,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -537,7 +502,7 @@ "x": 17, "y": 1 }, - "id": null, + "id": 56, "options": { "legend": { "calcs": [ @@ -558,7 +523,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [ { @@ -673,13 +638,12 @@ } ], "title": "Average Query Response Time", - "transformations": [], "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -708,7 +672,7 @@ "x": 0, "y": 5 }, - "id": null, + "id": 88, "options": { "colorMode": "value", "graphMode": "area", @@ -721,9 +685,11 @@ "fields": "", "values": false }, - "textMode": "auto" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -731,6 +697,7 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, + "enableDownSampling": true, "expressionList": [], "format": "time_series", "hide": false, @@ -748,7 +715,7 @@ "filter_dict": {}, "functions": [], "group_by": [], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", @@ -787,7 +754,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -824,7 +791,7 @@ "x": 3, "y": 5 }, - "id": null, + "id": 85, "options": { "colorMode": "value", "graphMode": "area", @@ -837,9 +804,11 @@ "fields": "", "values": false }, - "textMode": "auto" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -903,7 +872,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -936,7 +905,7 @@ "x": 6, "y": 5 }, - "id": null, + "id": 86, "options": { "colorMode": "value", "graphMode": "area", @@ -949,15 +918,17 @@ "fields": "", "values": false }, - "textMode": "auto" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "time_series", @@ -1015,14 +986,16 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, + "description": "select|insert|update|delete|replace|commit", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1036,6 +1009,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1065,7 +1039,8 @@ "value": 80 } ] - } + }, + "unit": "ops" }, "overrides": [] }, @@ -1075,15 +1050,15 @@ "x": 9, "y": 7 }, - "id": null, + "id": 33, "options": { "legend": { "calcs": [ "last", "max" ], - "displayMode": "list", - "placement": "bottom", + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -1098,23 +1073,16 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [ - { - "active": true, - "alias": "", - "expression": "", - "functions": [] - } - ], + "expressionList": [], "format": "time_series", "hide": false, "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "Com_$tag_command", + "promqlAlias": "$tag_command", "query_configs": [ { - "alias": "slow_queries", + "alias": "", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, @@ -1130,11 +1098,13 @@ ] } ], - "group_by": [], + "group_by": [ + "command" + ], "interval": 60, "interval_unit": "s", - "method": "SUM", - "metric_field": "mysql_global_status_slow_queries", + "method": "AVG", + "metric_field": "mysql_global_status_commands_total", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", @@ -1154,23 +1124,55 @@ "value": [ "$dbrole" ] + }, + { + "condition": "and", + "key": "command", + "method": "reg", + "value": [ + "select|insert|update|delete" + ] } ] } ], "refId": "B", - "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",command=~\"select|insert|update|delete|replace|commit\",instance_role=\"$dbrole\"}[2m])) >0", "step": "", "type": "range" } ], - "title": "Slow Queries", + "title": "QPS", + "transformations": [ + { + "id": "calculateField", + "options": { + "mode": "reduceRow", + "reduce": { + "include": [ + "commit", + "delete", + "delete_multi", + "insert", + "insert_select", + "replace", + "replace_select", + "select", + "update", + "update_multi", + "xa_commit" + ], + "reducer": "sum" + } + } + } + ], "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1178,6 +1180,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1191,6 +1194,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1231,7 +1235,7 @@ "x": 17, "y": 7 }, - "id": null, + "id": 83, "options": { "legend": { "calcs": [], @@ -1303,7 +1307,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -1331,7 +1335,7 @@ "x": 0, "y": 9 }, - "id": null, + "id": 15, "options": { "colorMode": "value", "graphMode": "none", @@ -1344,10 +1348,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -1409,7 +1415,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1418,7 +1424,9 @@ }, "custom": { "align": "auto", - "displayMode": "auto", + "cellOptions": { + "type": "auto" + }, "inspect": false }, "mappings": [], @@ -1445,10 +1453,12 @@ "y": 9 }, "hideTimeOverride": true, - "id": null, + "id": 10, "interval": "1h", "options": { + "cellHeight": "sm", "footer": { + "countRows": false, "fields": "", "reducer": [ "sum" @@ -1457,13 +1467,13 @@ }, "showHeader": true }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "expressionList": [], "format": "table", @@ -1531,7 +1541,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -1550,11 +1560,11 @@ }, "gridPos": { "h": 6, - "w": 17, + "w": 9, "x": 0, "y": 13 }, - "id": null, + "id": 90, "options": { "calculate": false, "cellGap": 1, @@ -1562,6 +1572,7 @@ "exponent": 0.5, "fill": "dark-orange", "mode": "scheme", + "reverse": false, "scale": "exponential", "scheme": "Oranges", "steps": 30 @@ -1579,7 +1590,8 @@ "layout": "auto" }, "tooltip": { - "show": true, + "mode": "single", + "showColorScale": false, "yHistogram": false }, "yAxis": { @@ -1587,7 +1599,7 @@ "reverse": false } }, - "pluginVersion": "9.1.0", + "pluginVersion": "10.4.10", "targets": [ { "cluster": [], @@ -1673,15 +1685,15 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1695,6 +1707,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1730,18 +1743,18 @@ }, "gridPos": { "h": 6, - "w": 7, - "x": 17, + "w": 8, + "x": 9, "y": 13 }, - "id": null, + "id": 32, "options": { "legend": { "calcs": [ "last", "max" ], - "displayMode": "table", + "displayMode": "list", "placement": "bottom", "showLegend": true }, @@ -1757,26 +1770,45 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "enableDownSampling": true, + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], "format": "time_series", + "hide": false, "host": [], - "mode": "code", + "mode": "ui", "module": [], - "promqlAlias": "Peak Threads Connected", + "promqlAlias": "Com_$tag_command", "query_configs": [ { - "alias": "Peak Threads Connected", + "alias": "slow_queries", "data_label": "exporter_dbm_mysqld_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, - "functions": [], + "functions": [ + { + "id": "increase", + "params": [ + { + "id": "window", + "value": "1m" + } + ] + } + ], "group_by": [], "interval": 60, "interval_unit": "s", - "method": "MAX", - "metric_field": "mysql_global_status_threads_connected", + "method": "SUM", + "metric_field": "mysql_global_status_slow_queries", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", @@ -1800,77 +1832,28 @@ ] } ], - "refId": "A", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "Max Ever Used", - "query_configs": [], "refId": "B", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_max_used_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "Max Conn Limited", - "query_configs": [], - "refId": "C", - "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_max_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", "step": "", "type": "range" } ], - "title": "MySQL Connections", + "title": "Slow Queries(1m SUM)", "type": "timeseries" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 19 - }, - "id": null, - "panels": [], - "title": "Command, Handlers", - "type": "row" - }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, + "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1884,6 +1867,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1918,12 +1902,12 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 20 + "h": 6, + "w": 7, + "x": 17, + "y": 13 }, - "id": null, + "id": 91, "options": { "legend": { "calcs": [ @@ -1931,7 +1915,7 @@ "max" ], "displayMode": "table", - "placement": "right", + "placement": "bottom", "showLegend": true }, "tooltip": { @@ -1948,40 +1932,28 @@ }, "expressionList": [], "format": "time_series", - "hide": false, "host": [], "mode": "code", "module": [], - "promqlAlias": "Com_$tag_command", + "promqlAlias": "Peak Threads Connected", "query_configs": [ { - "alias": "Com_$tag_command", + "alias": "Peak Threads Connected", + "data_label": "exporter_dbm_mysqld_exporter", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, - "functions": [ - { - "id": "rate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], - "group_by": [ - "command" - ], + "functions": [], + "group_by": [], "interval": 60, "interval_unit": "s", - "method": "sum_without_time", - "metric_field": "mysql_global_status_commands_total", + "method": "MAX", + "metric_field": "mysql_global_status_threads_connected", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", - "time_field": "", + "time_field": "time", "where": [ { "key": "cluster_domain", @@ -2001,328 +1973,358 @@ ] } ], - "refId": "B", - "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", + "refId": "A", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" - } - ], - "title": "Top Command Counters", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "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": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 12, - "y": 20 - }, - "id": null, - "options": { - "legend": { - "calcs": [ - "last", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [ - { - "active": true, - "alias": "", - "expression": "", - "functions": [] - } - ], + "expressionList": [], "format": "time_series", "hide": false, "host": [], "mode": "code", "module": [], - "promqlAlias": "$tag_handler", - "query_configs": [ - { - "alias": "$tag_handler", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ - { - "id": "rate", - "params": [ - { - "id": "window", - "value": "2m" - } - ] - } - ], - "group_by": [ - "handler" - ], - "interval": 60, - "interval_unit": "s", - "method": "sum_without_time", - "metric_field": "mysql_global_status_handlers_total", - "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "$dbrole" - ] - } - ] - } - ], + "promqlAlias": "Max Ever Used", + "query_configs": [], "refId": "B", - "source": "sum by(handler) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_handlers_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\",handler!~\"commit|rollback|savepoint.*|prepare\"}[2m]))", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_max_used_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" - } - ], - "title": "MySQL Handlers", - "type": "timeseries" - }, - { - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "fieldConfig": { - "defaults": { - "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": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 18, - "y": 20 - }, - "id": null, - "options": { - "legend": { - "calcs": [ - "last", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ { "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [ - { - "active": true, - "alias": "", - "expression": "", - "functions": [] - } - ], + "expressionList": [], "format": "time_series", "hide": false, "host": [], "mode": "code", "module": [], - "promqlAlias": "$tag_handler", - "query_configs": [ - { - "alias": "$tag_handler", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ + "promqlAlias": "Max Conn Limited", + "query_configs": [], + "refId": "C", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_max_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "MySQL Connections", + "type": "timeseries" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 82, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "fieldConfig": { + "defaults": { + "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": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 4 + }, + "id": 79, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ { - "id": "rate", - "params": [ + "alias": "slave=$tag_instance, master_serverid=$tag_master_server_id, $tag_channel_name", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance", + "master_uuid", + "channel_name", + "master_server_id" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_slave_status_seconds_behind_master", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ { - "id": "window", - "value": "2m" + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] } ] } ], - "group_by": [ - "handler" - ], - "interval": 60, - "interval_unit": "s", - "method": "sum_without_time", - "metric_field": "mysql_global_status_handlers_total", - "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "", - "where": [ + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Seconds Behind Master", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "fieldConfig": { + "defaults": { + "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": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 4 + }, + "id": 80, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" + "alias": "heartbeat_delay_sec, master=$tag_master_server_id", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "master_uuid", + "master_server_id" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_infodba_schema_heartbeat_delay_sec", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] }, { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "$dbrole" + "alias": "heartbeat_beat_sec, master=$tag_master_server_id", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "master_uuid", + "master_server_id" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_infodba_schema_heartbeat_beat_sec", + "refId": "b", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } ] } - ] + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" } ], - "refId": "B", - "source": "sum by(handler) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_handlers_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\",handler=~\"commit|rollback|savepoint.*|prepare\"}[2m]))", - "step": "", - "type": "range" + "title": "Master Slave Heartbeat Delay", + "type": "timeseries" } ], - "title": "MySQL Transaction Handlers", - "type": "timeseries" + "title": "Replication", + "type": "row" }, { "collapsed": true, @@ -2330,14 +2332,14 @@ "h": 1, "w": 24, "x": 0, - "y": 28 + "y": 20 }, - "id": null, + "id": 24, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -2394,9 +2396,9 @@ "h": 8, "w": 12, "x": 0, - "y": 3 + "y": 20 }, - "id": null, + "id": 25, "options": { "legend": { "calcs": [ @@ -2423,12 +2425,12 @@ "format": "time_series", "hide": false, "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "Questions", + "promqlAlias": "Com_$tag_command", "query_configs": [ { - "alias": "Questions", + "alias": "Com_$tag_command", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, @@ -2444,11 +2446,13 @@ ] } ], - "group_by": [], + "group_by": [ + "command" + ], "interval": 60, "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_global_status_questions", + "method": "sum_without_time", + "metric_field": "mysql_global_status_commands_total", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", @@ -2473,20 +2477,19 @@ } ], "refId": "B", - "source": "avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_questions{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))", + "source": "sum by(command) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_commands_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]) > 0)", "step": "", "type": "range" } ], - "title": "Questions", + "title": "Top Command Counters", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "**Peak Threads Connected** is number of peak number of connections MySQL had in the period of time\n\n**Peak Threads Running** is the peak number of threads considered \"Running\" by MySQL, not Sleeping or Waiting on Table level locks which can be indicative for workload spikes\n\n**Avg Threads Running** is the average number of Threads running over interval which can be indicative of sustained load", "fieldConfig": { "defaults": { "color": { @@ -2540,11 +2543,11 @@ }, "gridPos": { "h": 8, - "w": 12, + "w": 6, "x": 12, - "y": 3 + "y": 20 }, - "id": null, + "id": 26, "options": { "legend": { "calcs": [ @@ -2552,7 +2555,7 @@ "max" ], "displayMode": "table", - "placement": "right", + "placement": "bottom", "showLegend": true }, "tooltip": { @@ -2567,25 +2570,45 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], "format": "time_series", + "hide": false, "host": [], "mode": "code", "module": [], - "promqlAlias": "Peak Threads Connected", + "promqlAlias": "$tag_handler", "query_configs": [ { - "alias": "Peak Threads Connected", + "alias": "$tag_handler", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, - "functions": [], - "group_by": [], + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "handler" + ], "interval": 60, "interval_unit": "s", - "method": "MAX", - "metric_field": "mysql_global_status_threads_connected", + "method": "sum_without_time", + "metric_field": "mysql_global_status_handlers_total", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", @@ -2609,59 +2632,20 @@ ] } ], - "refId": "A", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "Peak Threads Running", - "query_configs": [], "refId": "B", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_running{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "Avg Threads Running", - "query_configs": [], - "refId": "C", - "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_running{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "source": "sum by(handler) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_handlers_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\",handler!~\"commit|rollback|savepoint.*|prepare\"}[2m]))", "step": "", "type": "range" } ], - "title": "MySQL Client Thread Activity", + "title": "MySQL Handlers", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { "defaults": { "color": { @@ -2715,11 +2699,11 @@ }, "gridPos": { "h": 8, - "w": 12, - "x": 0, - "y": 11 + "w": 6, + "x": 18, + "y": 20 }, - "id": null, + "id": 27, "options": { "legend": { "calcs": [ @@ -2727,7 +2711,7 @@ "max" ], "displayMode": "table", - "placement": "right", + "placement": "bottom", "showLegend": true }, "tooltip": { @@ -2742,25 +2726,45 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, - "expressionList": [], + "expressionList": [ + { + "active": true, + "alias": "", + "expression": "", + "functions": [] + } + ], "format": "time_series", + "hide": false, "host": [], "mode": "code", "module": [], - "promqlAlias": "Peak Threads Connected", + "promqlAlias": "$tag_handler", "query_configs": [ { - "alias": "Peak Threads Connected", + "alias": "$tag_handler", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, - "functions": [], - "group_by": [], + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [ + "handler" + ], "interval": 60, "interval_unit": "s", - "method": "MAX", - "metric_field": "mysql_global_status_threads_connected", + "method": "sum_without_time", + "metric_field": "mysql_global_status_handlers_total", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", @@ -2784,11 +2788,110 @@ ] } ], - "refId": "A", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "refId": "B", + "source": "sum by(handler) (rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_handlers_total{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\",handler=~\"commit|rollback|savepoint.*|prepare\"}[2m]))", "step": "", "type": "range" + } + ], + "title": "MySQL Transaction Handlers", + "type": "timeseries" + } + ], + "title": "Command, Handlers", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 8, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ { "cluster": [], "datasource": { @@ -2799,50 +2902,77 @@ "format": "time_series", "hide": false, "host": [], - "mode": "code", + "mode": "ui", "module": [], - "promqlAlias": "Max Ever Used", - "query_configs": [], + "promqlAlias": "Questions", + "query_configs": [ + { + "alias": "Questions", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [ + { + "id": "rate", + "params": [ + { + "id": "window", + "value": "2m" + } + ] + } + ], + "group_by": [], + "interval": 60, + "interval_unit": "s", + "method": "AVG", + "metric_field": "mysql_global_status_questions", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "time_field": "", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], "refId": "B", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_max_used_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "code", - "module": [], - "promqlAlias": "Max Conn", - "query_configs": [], - "refId": "C", - "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_max_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "source": "avg(rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_questions{cluster_domain=\"$cluster_domain\",instance_role=\"$dbrole\"}[2m]))", "step": "", "type": "range" } ], - "title": "MySQL Connections", + "title": "Questions", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "**Thread Cache Size** is the value of the [thread_cache_size](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_thread_cache_size) system variable that defines how many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache (unless it is full). As of MySQL 5.6.8, default thread cache size depends on the value of [max_connections](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections) and is capped at 100 threads. 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", + "description": "**Peak Threads Connected** is number of peak number of connections MySQL had in the period of time\n\n**Peak Threads Running** is the peak number of threads considered \"Running\" by MySQL, not Sleeping or Waiting on Table level locks which can be indicative for workload spikes\n\n**Avg Threads Running** is the average number of Threads running over interval which can be indicative of sustained load", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -2856,6 +2986,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -2892,9 +3023,9 @@ "h": 8, "w": 12, "x": 12, - "y": 11 + "y": 22 }, - "id": null, + "id": 4, "options": { "legend": { "calcs": [ @@ -2922,7 +3053,7 @@ "host": [], "mode": "code", "module": [], - "promqlAlias": "Thread Cache Size", + "promqlAlias": "Peak Threads Connected", "query_configs": [ { "alias": "Peak Threads Connected", @@ -2960,7 +3091,7 @@ } ], "refId": "A", - "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_thread_cache_size{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" }, @@ -2976,10 +3107,10 @@ "host": [], "mode": "code", "module": [], - "promqlAlias": "Threads Created", + "promqlAlias": "Peak Threads Running", "query_configs": [], "refId": "B", - "source": "rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_created{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m])", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_running{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" }, @@ -2995,42 +3126,30 @@ "host": [], "mode": "code", "module": [], - "promqlAlias": "Threads Cached", + "promqlAlias": "Avg Threads Running", "query_configs": [], "refId": "C", - "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_cached{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_running{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" } ], - "title": "MySQL Thread Cache", + "title": "MySQL Client Thread Activity", "type": "timeseries" - } - ], - "title": "Common", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 29 - }, - "id": null, - "panels": [ + }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, + "description": "**Max Connections** is the maximum permitted number of simultaneous client connections. This is the value of the ``max_connections`` variable.\n\n**Max Used Connections** is the maximum number of connections that have been in use simultaneously since the server was started.\n\n**Connections** is the number of connection attempts (successful or not) to the MySQL server.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3044,6 +3163,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3072,8 +3192,7 @@ "value": 80 } ] - }, - "unit": "dtdurations" + } }, "overrides": [] }, @@ -3081,19 +3200,22 @@ "h": 8, "w": 12, "x": 0, - "y": 4 + "y": 30 }, - "id": null, + "id": 5, "options": { "legend": { - "calcs": [], + "calcs": [ + "last", + "max" + ], "displayMode": "table", - "placement": "bottom", + "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, "targets": [ @@ -3106,32 +3228,26 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "Peak Threads Connected", "query_configs": [ { - "alias": "slave=$tag_instance, master_serverid=$tag_master_server_id, $tag_channel_name", - "data_label": "exporter_dbm_mysqld_exporter", + "alias": "Peak Threads Connected", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], - "group_by": [ - "instance", - "master_uuid", - "channel_name", - "master_server_id" - ], - "interval": "auto", + "group_by": [], + "interval": 60, "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_slave_status_seconds_behind_master", + "method": "MAX", + "metric_field": "mysql_global_status_threads_connected", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", - "time_field": "time", + "time_field": "", "where": [ { "key": "cluster_domain", @@ -3139,30 +3255,78 @@ "value": [ "$cluster_domain" ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] } ] } ], "refId": "A", - "source": "", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_connected{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Max Ever Used", + "query_configs": [], + "refId": "B", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_max_used_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Max Conn", + "query_configs": [], + "refId": "C", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_max_connections{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" } ], - "title": "Seconds Behind Master", + "title": "MySQL Connections", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, + "description": "**Thread Cache Size** is the value of the [thread_cache_size](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_thread_cache_size) system variable that defines how many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache (unless it is full). As of MySQL 5.6.8, default thread cache size depends on the value of [max_connections](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections) and is capped at 100 threads. 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", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3176,6 +3340,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3204,8 +3369,7 @@ "value": 80 } ] - }, - "unit": "dtdurations" + } }, "overrides": [] }, @@ -3213,19 +3377,22 @@ "h": 8, "w": 12, "x": 12, - "y": 4 + "y": 30 }, - "id": null, + "id": 6, "options": { "legend": { - "calcs": [], + "calcs": [ + "last", + "max" + ], "displayMode": "table", - "placement": "bottom", + "placement": "right", "showLegend": true }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, "targets": [ @@ -3238,30 +3405,26 @@ "expressionList": [], "format": "time_series", "host": [], - "mode": "ui", + "mode": "code", "module": [], - "promqlAlias": "", + "promqlAlias": "Thread Cache Size", "query_configs": [ { - "alias": "heartbeat_delay_sec, master=$tag_master_server_id", - "data_label": "exporter_dbm_mysqld_exporter", + "alias": "Peak Threads Connected", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], - "group_by": [ - "master_uuid", - "master_server_id" - ], - "interval": "auto", + "group_by": [], + "interval": 60, "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_infodba_schema_heartbeat_delay_sec", + "method": "MAX", + "metric_field": "mysql_global_status_threads_connected", "refId": "a", "result_table_id": "exporter_dbm_mysqld_exporter.__default__", "result_table_label": "component", - "time_field": "time", + "time_field": "", "where": [ { "key": "cluster_domain", @@ -3269,51 +3432,67 @@ "value": [ "$cluster_domain" ] - } - ] - }, - { - "alias": "heartbeat_beat_sec, master=$tag_master_server_id", - "data_label": "exporter_dbm_mysqld_exporter", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "master_uuid", - "master_server_id" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_infodba_schema_heartbeat_beat_sec", - "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ + }, { - "key": "cluster_domain", + "condition": "and", + "key": "instance_role", "method": "eq", "value": [ - "$cluster_domain" + "$dbrole" ] } ] } ], "refId": "A", - "source": "", + "source": "max(max_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_variables_thread_cache_size{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Threads Created", + "query_configs": [], + "refId": "B", + "source": "rate(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_created{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m])", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "Threads Cached", + "query_configs": [], + "refId": "C", + "source": "avg(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:__default__:mysql_global_status_threads_cached{cluster_domain=~\"$cluster_domain\",instance_role=~\"$dbrole\"}[1m]))", "step": "", "type": "range" } ], - "title": "Master Slave Heartbeat Delay", + "title": "MySQL Thread Cache", "type": "timeseries" } ], - "title": "Replication", + "title": "Common", "type": "row" }, { @@ -3322,14 +3501,14 @@ "h": 1, "w": 24, "x": 0, - "y": 30 + "y": 22 }, - "id": null, + "id": 59, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3338,6 +3517,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3351,6 +3531,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3388,9 +3569,9 @@ "h": 6, "w": 12, "x": 0, - "y": 5 + "y": 39 }, - "id": null, + "id": 57, "options": { "legend": { "calcs": [ @@ -3458,13 +3639,12 @@ } ], "title": "Proxy Conn", - "transformations": [], "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3473,6 +3653,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3486,6 +3667,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3522,9 +3704,9 @@ "h": 6, "w": 12, "x": 12, - "y": 5 + "y": 39 }, - "id": null, + "id": 60, "options": { "legend": { "calcs": [], @@ -3602,7 +3784,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3611,6 +3793,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3624,6 +3807,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3661,9 +3845,9 @@ "h": 6, "w": 12, "x": 0, - "y": 11 + "y": 45 }, - "id": null, + "id": 94, "options": { "legend": { "calcs": [], @@ -3800,7 +3984,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -3809,6 +3993,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -3822,6 +4007,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -3859,9 +4045,9 @@ "h": 6, "w": 12, "x": 12, - "y": 11 + "y": 45 }, - "id": null, + "id": 96, "options": { "legend": { "calcs": [], @@ -3972,13 +4158,12 @@ } ], "title": "MySQL Network Traffic", - "transformations": [], "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -3987,6 +4172,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -4000,6 +4186,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -4036,9 +4223,9 @@ "h": 6, "w": 12, "x": 0, - "y": 17 + "y": 51 }, - "id": null, + "id": 95, "options": { "legend": { "calcs": [], @@ -4125,7 +4312,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "磁盘io使用率", "fieldConfig": { @@ -4134,6 +4321,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -4147,6 +4335,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -4183,9 +4372,9 @@ "h": 6, "w": 12, "x": 12, - "y": 17 + "y": 51 }, - "id": null, + "id": 97, "options": { "legend": { "calcs": [], @@ -4270,14 +4459,14 @@ "h": 1, "w": 24, "x": 0, - "y": 31 + "y": 23 }, - "id": null, + "id": 49, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4335,9 +4524,9 @@ "h": 5, "w": 8, "x": 0, - "y": 6 + "y": 24 }, - "id": null, + "id": 50, "options": { "legend": { "calcs": [], @@ -4415,7 +4604,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4474,9 +4663,9 @@ "h": 5, "w": 8, "x": 8, - "y": 6 + "y": 24 }, - "id": null, + "id": 52, "options": { "legend": { "calcs": [], @@ -4590,7 +4779,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -4649,9 +4838,9 @@ "h": 5, "w": 8, "x": 16, - "y": 6 + "y": 24 }, - "id": null, + "id": 54, "options": { "legend": { "calcs": [], @@ -4815,7 +5004,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -4873,9 +5062,9 @@ "h": 5, "w": 8, "x": 0, - "y": 11 + "y": 29 }, - "id": null, + "id": 11, "options": { "legend": { "calcs": [], @@ -4961,9 +5150,9 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, - "description": "磁盘空间使用率", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -5011,7 +5200,8 @@ "value": 80 } ] - } + }, + "unit": "KBs" }, "overrides": [] }, @@ -5019,14 +5209,14 @@ "h": 5, "w": 8, "x": 8, - "y": 11 + "y": 29 }, - "id": null, + "id": 98, "options": { "legend": { "calcs": [], - "displayMode": "list", - "placement": "bottom", + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -5048,20 +5238,22 @@ "host": [], "mode": "ui", "module": [], - "promqlAlias": "", + "promqlAlias": "ioutil", "query_configs": [ { - "alias": "ioutil", + "alias": "$tag_device_name : readBytes", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], - "group_by": [], - "interval": "auto", + "group_by": [ + "device_name" + ], + "interval": 60, "interval_unit": "s", "method": "MAX", - "metric_field": "util", + "metric_field": "rkb_s", "refId": "a", "result_table_id": "dbm_system.io", "result_table_label": "os", @@ -5083,21 +5275,57 @@ ] } ] + }, + { + "alias": "$tag_device_name : writeBytes", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "device_name" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "wkb_s", + "refId": "b", + "result_table_id": "dbm_system.io", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] } ], "refId": "C", - "source": "", + "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", "step": "", "type": "range" } ], - "title": "IO util", + "title": "Disk IO Throughput per Device", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -5156,9 +5384,9 @@ "h": 5, "w": 8, "x": 16, - "y": 11 + "y": 29 }, - "id": null, + "id": 53, "options": { "legend": { "calcs": [], @@ -5224,21 +5452,215 @@ ] }, { - "alias": "Outbound", + "alias": "Outbound", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "device_name" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "speed_sent", + "refId": "b", + "result_table_id": "dbm_system.net", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "C", + "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "step": "", + "type": "range" + } + ], + "title": "MySQL Network Traffic", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "P3XSxkgSz" + }, + "description": "磁盘空间使用率", + "fieldConfig": { + "defaults": { + "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": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 34 + }, + "id": 89, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "Total $tag_mount_point", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "total", + "refId": "a", + "result_table_id": "dbm_system.disk", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "$dbrole" + ] + } + ] + } + ], + "refId": "B", + "source": "", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "bkmonitor_timeseries" + }, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "Used $tag_mount_point", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], "group_by": [ - "device_name" + "mount_point" ], - "interval": 60, + "interval": "auto", "interval_unit": "s", - "method": "MAX", - "metric_field": "speed_sent", - "refId": "b", - "result_table_id": "dbm_system.net", + "method": "AVG", + "metric_field": "used", + "refId": "a", + "result_table_id": "dbm_system.disk", "result_table_label": "os", "time_field": "time", "where": [ @@ -5261,18 +5683,18 @@ } ], "refId": "C", - "source": "max(max_over_time(bkmonitor:dbm_system:io:w_s{bk_target_ip=\"$host\"}[1m]))", + "source": "", "step": "", "type": "range" } ], - "title": "MySQL Network Traffic", + "title": "Disk Size Used", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -5329,10 +5751,10 @@ "gridPos": { "h": 5, "w": 8, - "x": 0, - "y": 16 + "x": 8, + "y": 34 }, - "id": null, + "id": 51, "options": { "legend": { "calcs": [], @@ -5362,77 +5784,19 @@ "promqlAlias": "", "query_configs": [ { - "alias": "Total $tag_mount_point", - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "mount_point" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "total", - "refId": "a", - "result_table_id": "dbm_system.disk", - "result_table_label": "os", - "time_field": "time", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "$dbrole" - ] - } - ] - } - ], - "refId": "B", - "source": "", - "step": "", - "type": "range" - }, - { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "hide": false, - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "Used $tag_mount_point", + "alias": "ioutil", "data_source_label": "bk_monitor", "data_type_label": "time_series", "display": true, "filter_dict": {}, "functions": [], - "group_by": [ - "mount_point" - ], + "group_by": [], "interval": "auto", "interval_unit": "s", - "method": "AVG", - "metric_field": "used", + "method": "MAX", + "metric_field": "util", "refId": "a", - "result_table_id": "dbm_system.disk", + "result_table_id": "dbm_system.io", "result_table_label": "os", "time_field": "time", "where": [ @@ -5460,13 +5824,13 @@ "type": "range" } ], - "title": "Disk Size Used", + "title": "IO util", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -5523,11 +5887,11 @@ }, "gridPos": { "h": 5, - "w": 16, - "x": 8, - "y": 16 + "w": 8, + "x": 16, + "y": 34 }, - "id": null, + "id": 77, "options": { "legend": { "calcs": [], @@ -5663,14 +6027,14 @@ "h": 1, "w": 24, "x": 0, - "y": 32 + "y": 24 }, - "id": null, + "id": 70, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -5678,6 +6042,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -5691,6 +6056,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" @@ -5731,9 +6097,9 @@ "h": 9, "w": 12, "x": 0, - "y": 37 + "y": 25 }, - "id": null, + "id": 65, "interval": "2h", "options": { "legend": { @@ -5756,6 +6122,7 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, + "enableDownSampling": true, "expressionList": [], "format": "time_series", "host": [], @@ -5776,7 +6143,7 @@ "instance", "instance_role" ], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", @@ -5807,7 +6174,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -5815,6 +6182,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -5828,6 +6196,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -5865,10 +6234,10 @@ "h": 9, "w": 12, "x": 12, - "y": 37 + "y": 25 }, - "id": null, - "interval": "1h", + "id": 84, + "interval": "2h", "options": { "legend": { "calcs": [ @@ -5890,6 +6259,7 @@ "type": "bkmonitor-timeseries-datasource", "uid": "bkmonitor_timeseries" }, + "enableDownSampling": true, "expressionList": [], "format": "time_series", "host": [], @@ -5910,7 +6280,7 @@ "instance_host", "mount_point" ], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "AVG", "metric_field": "mysql_datadir_df_used_mb", @@ -5941,7 +6311,7 @@ "instance_host", "mount_point" ], - "interval": "auto", + "interval": 7200, "interval_unit": "s", "method": "AVG", "metric_field": "mysql_datadir_df_total_mb", @@ -5971,8 +6341,8 @@ }, { "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" }, "fieldConfig": { "defaults": { @@ -5980,6 +6350,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -5993,6 +6364,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -6030,9 +6402,9 @@ "h": 9, "w": 12, "x": 0, - "y": 46 + "y": 34 }, - "id": null, + "id": 100, "interval": "24h", "options": { "legend": { @@ -6052,52 +6424,106 @@ }, "targets": [ { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "$tag_database_name", - "data_label": "dbm_report_channel", - "data_source_label": "custom", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [], - "group_by": [ - "database_name" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_database_size", - "refId": "a", - "result_table_id": "bkmonitor_time_series_553410.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ + "data": { + "alias": "$tag_database_name", + "conditions": [ + [ { - "key": "cluster_domain", - "method": "eq", + "key": "vpcy9x58nk", + "list": [ + { + "id": "cluster_domain", + "name": "cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "cluster_domain" + }, + { + "key": "tpjzn5m2d1", + "list": [ + { + "id": "is", + "name": "is" + }, + { + "id": "is one of", + "name": "is one of" + }, + { + "id": "is not", + "name": "is not" + }, + { + "id": "is not one of", + "name": "is not one of" + }, + { + "id": "gt", + "name": ">" + }, + { + "id": "gte", + "name": ">=" + }, + { + "id": "lt", + "name": "<" + }, + { + "id": "lte", + "name": "<=" + } + ], + "type": "method", + "value": "is" + }, + { + "key": "jaz8ohp0lx", + "list": [], + "type": "value", "value": [ "$cluster_domain" ] } ] + ], + "dimensions": [ + "database_name" + ], + "index": { + "id": [ + "host_process", + 16118 + ], + "labels": [ + "进程", + "[采集项]mysql_db_table_size" + ] + }, + "indexSetString": "", + "method": "max", + "metric": "database_size", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" + }, + "refId": "A" } ], "timeFrom": "7d", @@ -6106,8 +6532,8 @@ }, { "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" }, "fieldConfig": { "defaults": { @@ -6115,6 +6541,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -6128,6 +6555,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -6165,9 +6593,9 @@ "h": 9, "w": 12, "x": 12, - "y": 46 + "y": 34 }, - "id": null, + "id": 101, "interval": "24h", "options": { "legend": { @@ -6187,67 +6615,111 @@ }, "targets": [ { - "cluster": [], - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" - }, - "expressionList": [], - "format": "time_series", - "host": [], - "mode": "ui", - "module": [], - "promqlAlias": "", - "query_configs": [ - { - "alias": "$tag_database_name.$tag_table_name", - "data_label": "dbm_report_channel", - "data_source_label": "custom", - "data_type_label": "time_series", - "display": true, - "filter_dict": {}, - "functions": [ + "data": { + "alias": "$tag_database_name . $tag_table_name", + "conditions": [ + [ { - "id": "topk", - "params": [ + "key": "vffqcs8tyr", + "list": [ { - "id": "k", - "value": "30" + "id": "cluster_domain", + "name": "cluster_domain" } - ] - } - ], - "group_by": [ - "database_name", - "table_name" - ], - "interval": "auto", - "interval_unit": "s", - "method": "AVG", - "metric_field": "mysql_table_size", - "refId": "a", - "result_table_id": "bkmonitor_time_series_553410.__default__", - "result_table_label": "component", - "time_field": "time", - "where": [ + ], + "open": false, + "type": "key", + "value": "cluster_domain" + }, { - "key": "cluster_domain", - "method": "eq", + "key": "eeg1fc2lno", + "list": [ + { + "id": "is", + "name": "is" + }, + { + "id": "is one of", + "name": "is one of" + }, + { + "id": "is not", + "name": "is not" + }, + { + "id": "is not one of", + "name": "is not one of" + }, + { + "id": "gt", + "name": ">" + }, + { + "id": "gte", + "name": ">=" + }, + { + "id": "lt", + "name": "<" + }, + { + "id": "lte", + "name": "<=" + } + ], + "type": "method", + "value": "is" + }, + { + "key": "g2ggfn8s0i", + "list": [], + "type": "value", "value": [ "$cluster_domain" ] } ] + ], + "dimensions": [ + "database_name", + "table_name" + ], + "index": { + "id": [ + "host_process", + 16118 + ], + "labels": [ + "进程", + "[采集项]mysql_db_table_size" + ] + }, + "indexSetString": "", + "method": "max", + "metric": "table_size", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ], - "refId": "A", - "source": "", - "step": "", - "type": "range" + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "hHrSbzgIk" + }, + "refId": "A" } ], "timeFrom": "7d", - "title": "Table Size Top 30 (ibd)", + "title": "Table Size Top 50 (ibd)", "type": "timeseries" } ], @@ -6260,14 +6732,14 @@ "h": 1, "w": 24, "x": 0, - "y": 33 + "y": 25 }, - "id": null, + "id": 19, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -6328,7 +6800,7 @@ "x": 0, "y": 6 }, - "id": null, + "id": 30, "options": { "legend": { "calcs": [ @@ -6511,7 +6983,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -6572,7 +7044,7 @@ "x": 12, "y": 6 }, - "id": null, + "id": 31, "options": { "legend": { "calcs": [ @@ -6762,14 +7234,14 @@ "h": 1, "w": 24, "x": 0, - "y": 34 + "y": 26 }, - "id": null, + "id": 41, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -6829,7 +7301,7 @@ "x": 0, "y": 35 }, - "id": null, + "id": 42, "options": { "legend": { "calcs": [ @@ -7006,7 +7478,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "Shows how many selects were done without indexes. Such operations can impact performance.", "fieldConfig": { @@ -7066,7 +7538,7 @@ "x": 12, "y": 35 }, - "id": null, + "id": 43, "options": { "legend": { "calcs": [ @@ -7199,7 +7671,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -7259,7 +7731,7 @@ "x": 0, "y": 40 }, - "id": null, + "id": 36, "options": { "legend": { "calcs": [ @@ -7348,7 +7820,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -7409,7 +7881,7 @@ "x": 12, "y": 40 }, - "id": null, + "id": 37, "options": { "legend": { "calcs": [ @@ -7596,7 +8068,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -7657,7 +8129,7 @@ "x": 0, "y": 45 }, - "id": null, + "id": 38, "options": { "legend": { "calcs": [ @@ -7844,7 +8316,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -7905,7 +8377,7 @@ "x": 12, "y": 45 }, - "id": null, + "id": 39, "options": { "legend": { "calcs": [ @@ -8045,14 +8517,14 @@ "h": 1, "w": 24, "x": 0, - "y": 35 + "y": 27 }, - "id": null, + "id": 45, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -8112,7 +8584,7 @@ "x": 0, "y": 7 }, - "id": null, + "id": 46, "options": { "legend": { "calcs": [ @@ -8203,7 +8675,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -8264,7 +8736,7 @@ "x": 16, "y": 7 }, - "id": null, + "id": 47, "options": { "legend": { "calcs": [ @@ -8411,14 +8883,14 @@ "h": 1, "w": 24, "x": 0, - "y": 36 + "y": 28 }, - "id": null, + "id": 72, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -8478,7 +8950,7 @@ "x": 0, "y": 37 }, - "id": null, + "id": 62, "options": { "legend": { "calcs": [ @@ -8591,7 +9063,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -8651,7 +9123,7 @@ "x": 12, "y": 37 }, - "id": null, + "id": 63, "options": { "legend": { "calcs": [], @@ -8727,7 +9199,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "description": "", "fieldConfig": { @@ -8737,7 +9209,9 @@ }, "custom": { "align": "auto", - "displayMode": "auto", + "cellOptions": { + "type": "auto" + }, "filterable": false, "inspect": false }, @@ -8804,7 +9278,7 @@ "x": 0, "y": 42 }, - "id": null, + "id": 13, "options": { "footer": { "fields": "", @@ -8941,7 +9415,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -9001,7 +9475,7 @@ "x": 12, "y": 42 }, - "id": null, + "id": 67, "options": { "legend": { "calcs": [], @@ -9084,14 +9558,14 @@ "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 29 }, - "id": null, + "id": 76, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -9151,7 +9625,7 @@ "x": 0, "y": 38 }, - "id": null, + "id": 73, "interval": "5m", "options": { "legend": { @@ -9233,7 +9707,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "fieldConfig": { "defaults": { @@ -9293,7 +9767,7 @@ "x": 12, "y": 38 }, - "id": null, + "id": 74, "interval": "5m", "options": { "legend": { @@ -9376,8 +9850,7 @@ "type": "row" } ], - "schemaVersion": 37, - "style": "dark", + "schemaVersion": 39, "tags": [ "tendbha" ], @@ -9391,10 +9864,10 @@ }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", - "hide": 2, + "hide": 0, "includeAll": false, "label": "app", "multi": false, @@ -9422,12 +9895,12 @@ { "current": { "selected": false, - "text": "", - "value": "" + "text": "gamedb.odatadb0.spiderpub.db", + "value": "gamedb.odatadb0.spiderpub.db" }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -9492,9 +9965,14 @@ "selected": false, "text": "backend_slave", "value": "backend_slave" + }, + { + "selected": false, + "text": "backend_repeater", + "value": "backend_repeater" } ], - "query": "backend_master,backend_slave", + "query": "backend_master,backend_slave,backend_repeater", "queryValue": "", "refresh": 1, "skipUrlSync": false, @@ -9503,12 +9981,12 @@ { "current": { "selected": false, - "text": "", - "value": "" + "text": "11.154.231.226", + "value": "11.154.231.226" }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", "description": "host", @@ -9562,7 +10040,7 @@ }, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "P3XSxkgSz" }, "definition": "- Blueking Monitor - 维度", "hide": 2, @@ -9616,6 +10094,6 @@ "timezone": "default", "title": "MySQL-HA", "uid": "8wWk5T64z", - "version": 14, + "version": 23, "weekStart": "" } diff --git a/dbm-ui/backend/bk_dataview/dashboards/readme.md b/dbm-ui/backend/bk_dataview/dashboards/readme.md index 1735ea8179..bf71f3570e 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/readme.md +++ b/dbm-ui/backend/bk_dataview/dashboards/readme.md @@ -41,24 +41,12 @@ ___________________________________ "tags": ["tendbsingle", "tendbha", "tendbcluster", "慢查询"], ``` -# 刷新监控数据源ID:bkmonitor_timeseries +# 替换下钻仪表盘的地址为占位符 ``` cd backend/bk_dataview/dashboards/json -find . -type f -name "*.json" -exec sed -i '' -e 's#${DS_蓝鲸监控_-_指标数据}#bkmonitor_timeseries#g' {} \; -find . -type f -name "*.json" -exec sed -i '' -e 's#${DS_蓝鲸监控_- 指标数据}#bkmonitor_timeseries#g' {} \; -find . -type f -name "*.json" -exec sed -i '' -e 's#"editable": true#"editable": false#g' {} \; -find . -type f -name "*.json" -exec sed -i '' -e 's#bkmonitor:system:#bkmonitor:dbm_system:#g' {} \; -``` -# 批量替换基础指标来源:system -> dbm_system -``` -find . -type f -name "*.json" -exec sed -i '' -e 's#bkmonitor:system:#bkmonitor:dbm_system:#g' {} \; -find . -type f -name "*.json" -exec sed -i '' -e 's#"result_table_id": "system.#"result_table_id": "dbm_system.#g' {} \; +find . -type f -name "*.json" -exec sed -i '' -e 's#"url": "\(.*\)/grafana/\(.*\)orgId=[0-9]*\(.*\)"#"url": "{BK_SAAS_HOST}/grafana/\2orgId=1\3"#' {} \; ``` -# 批量替换 id 为 null: 「"id": 123,」 -> 「"id": null,」 -``` -find . -type f -name "*.json" -exec sed -i '' -e 's#"id": [0-9]*,#"id": null,#g' {} \; -``` # 这里按需隐藏变量,不暴露所有变量 templating.list.hide 设置为 2,这里一般把需暴露出来的变量设置为 0,不暴露的设置为 2 diff --git a/dbm-ui/backend/bk_dataview/grafana/provisioning.py b/dbm-ui/backend/bk_dataview/grafana/provisioning.py index 03d63d3f22..df18938667 100644 --- a/dbm-ui/backend/bk_dataview/grafana/provisioning.py +++ b/dbm-ui/backend/bk_dataview/grafana/provisioning.py @@ -93,18 +93,92 @@ def datasources(self, request, org_name: str, org_id: int) -> List[Datasource]: for ds in conf["datasources"]: yield Datasource(**ds) + @staticmethod + def replace_file_content(file_content: str, bkm_dbm_report: dict) -> str: + """替换文件内容""" + + # 全局变量替换 + file_content = file_content.replace("{event_data_id}", str(bkm_dbm_report["event"]["data_id"])) + file_content = file_content.replace("{metric_data_id}", str(bkm_dbm_report["metric"]["data_id"])) + file_content = file_content.replace("{BK_SAAS_HOST}", env.BK_SAAS_HOST) + + # 刷新监控数据源ID:bkmonitor_timeseries + file_content = file_content.replace("${DS_蓝鲸监控_-_指标数据}", "bkmonitor_timeseries") + file_content = file_content.replace("${DS_蓝鲸监控_- 指标数据}", "bkmonitor_timeseries") + file_content = file_content.replace('"editable": true', '"editable": false') + + # 批量替换基础指标来源:system -> dbm_system + file_content = file_content.replace("bkmonitor:system:", "bkmonitor:dbm_system:") + file_content = file_content.replace('"result_table_id": "system.', '"result_table_id": "dbm_system.') + return file_content + + @staticmethod + def get_obj_datasource_type_uid(obj) -> tuple: + datasource_type = obj.get("datasource", {}).get("type") + if datasource_type == "bkmonitor-timeseries-datasource": + uid = "bkmonitor_timeseries" + elif datasource_type == "bk_log_datasource": + uid = "bklog" + else: + uid = "unknown" + return datasource_type, uid + + @classmethod + def replace_dashboard(cls, dashboard: dict, used_index_name: list, index_name_id_map: dict): + """ + 调整仪表盘的一些参数 + """ + + # 使用到日志数据源的,需要替换填充索引集ID + for panel_index, panel in enumerate(dashboard["panels"]): + # 递归处理所有 panel + if "panels" in panel: + dashboard["panels"][panel_index] = cls.replace_dashboard(panel, used_index_name, index_name_id_map) + datasource_type, panel_uid = cls.get_obj_datasource_type_uid(panel) + if datasource_type == "bkmonitor-timeseries-datasource": + dashboard["panels"][panel_index]["datasource"]["uid"] = panel_uid + if datasource_type == "bk_log_datasource": + dashboard["panels"][panel_index]["datasource"]["uid"] = panel_uid + for target_index, target in enumerate(panel["targets"]): + for label in target["data"]["index"].get("labels", []): + for index_name in used_index_name: + if index_name in label: + index_set_id = index_name_id_map.get(index_name, 0) + dashboard["panels"][panel_index]["targets"][target_index]["data"]["index"]["id"] = [ + index_set_id + ] + # 处理 targets 的 datasource uid + for target_index, target in enumerate(panel.get("targets", [])): + datasource_type, target_uid = cls.get_obj_datasource_type_uid(target) + if datasource_type: + dashboard["panels"][panel_index]["targets"][target_index]["datasource"]["uid"] = target_uid + + for tpl_index, tpl in enumerate(dashboard.get("templating", {}).get("list", [])): + datasource_type, tpl_uid = cls.get_obj_datasource_type_uid(tpl) + if datasource_type: + dashboard["templating"]["list"][tpl_index]["datasource"]["uid"] = tpl_uid + + return dashboard + def dashboards(self, request, org_name: str, org_id: int) -> List[Dashboard]: """固定目录下的json文件, 自动注入""" bkm_dbm_report = SystemSettings.get_setting_value(key=SystemSettingsEnum.BKM_DBM_REPORT.value) index_set = BKLogApi.search_index_set({"space_uid": f"bkcc__{env.DBA_APP_BK_BIZ_ID}"}) - mysql_slow_log_index_set_id = 0 - redis_slow_log_index_set_id = 0 + index_name_id_map = {} + # 在 grafana 中被使用的索引名 + used_index_name = [ + "mysql_slowlog", + "mysql_db_table_size", + "redis_slowlog", + "redis_hotkey", + "redis_bigkey", + "redis_keymod", + ] for index in index_set: - if "mysql_slowlog" in index["index_set_name"]: - mysql_slow_log_index_set_id = index["index_set_id"] - if "redis_slowlog" in index["index_set_name"]: - redis_slow_log_index_set_id = index["index_set_id"] + for name in used_index_name: + if name in index["index_set_name"]: + index_name_id_map[name] = index["index_set_id"] with os_env(ORG_NAME=org_name, ORG_ID=org_id): for suffix in self.file_suffix: @@ -115,35 +189,16 @@ def dashboards(self, request, org_name: str, org_id: int) -> List[Dashboard]: for path in glob.glob(paths): with open(path, "rb") as fh: file_content = fh.read().decode() + file_content = self.replace_file_content(file_content, bkm_dbm_report) - # 全局变量替换 - file_content = file_content.replace( - "{event_data_id}", str(bkm_dbm_report["event"]["data_id"]) - ) - file_content = file_content.replace( - "{metric_data_id}", str(bkm_dbm_report["metric"]["data_id"]) - ) - file_content = file_content.replace("{BK_SAAS_HOST}", env.BK_SAAS_HOST) try: dashboard = json.loads(file_content) except JSONDecodeError as err: logger.error(f"Failed to load {os.path.basename(path)}") raise err - # 慢查询特殊处理,补充索引集ID - if "mysql-slowlog.json" in path: - for panel_index, panel in enumerate(dashboard["panels"]): - for target_index, target in enumerate(panel["targets"]): - dashboard["panels"][panel_index]["targets"][target_index]["data"]["index"][ - "id" - ].append(mysql_slow_log_index_set_id) - if "postgres-slowlog.json" in path: - for panel_index, panel in enumerate(dashboard["panels"]): - for target_index, target in enumerate(panel["targets"]): - dashboard["panels"][panel_index]["targets"][target_index]["data"]["index"][ - "id" - ].append(redis_slow_log_index_set_id) - + dashboard["id"] = None + dashboard = self.replace_dashboard(dashboard, used_index_name, index_name_id_map) title = dashboard.get("title") if not title: continue diff --git a/helm-charts/bk-dbm/values.yaml b/helm-charts/bk-dbm/values.yaml index 19063d3858..1350ceeadc 100644 --- a/helm-charts/bk-dbm/values.yaml +++ b/helm-charts/bk-dbm/values.yaml @@ -308,7 +308,7 @@ grafana: image: registry: "mirrors.tencent.com" repository: "build/blueking/bk-monitor-grafana" - tag: 3.7.348 + tag: 3.9.365 admin: user: admin password: admin