From 22ecf36dc5b9d4190935fc9f7f630fef0459270c Mon Sep 17 00:00:00 2001 From: seanlook Date: Tue, 22 Apr 2025 21:16:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(mysql):=20=E4=BC=98=E5=8C=96=20mysql=20?= =?UTF-8?q?=E6=85=A2=E6=9F=A5=E8=AF=A2=E8=A7=86=E5=9B=BE=20#10235?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pkg/consumer/mysql_table_size.go | 4 +- .../consumer/mysql_table_size_for_doris.go | 4 +- .../dashboards/json/mysql-slowlog.json | 5414 ++++++++++++----- .../dashboards/json/tendbcluster-table.json | 664 +- .../dashboards/json/tendbcluster.json | 563 +- .../dashboards/json/tendbha-table.json | 1594 +++++ .../bk_dataview/dashboards/json/tendbha.json | 1098 ++-- .../bk_dataview/grafana/provisioning.py | 2 + helm-charts/bk-dbm/Chart.lock | 6 +- helm-charts/bk-dbm/Chart.yaml | 6 +- .../charts/bkdata-kafka-consumer/Chart.yaml | 4 +- .../bkdata-kafka-consumer-configmap.yaml | 3 + 12 files changed, 6603 insertions(+), 2759 deletions(-) create mode 100644 dbm-ui/backend/bk_dataview/dashboards/json/tendbha-table.json diff --git a/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size.go b/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size.go index 8edec1385d..e460f031a8 100644 --- a/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size.go +++ b/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size.go @@ -92,10 +92,10 @@ func (c *MysqlTableSize) ConsumeClaim(session sarama.ConsumerGroupSession, claim if err := c.HandleMessageTryBatch(items, c.Sinker, c.Db); err != nil { slog.Error("handle message batch", err) } else { + slog.Info("sink message", slog.String("key", string(msgs[len(msgs)-1].Key))) session.MarkMessage(msgs[len(msgs)-1], "") items = items[:0] msgs = msgs[:0] - slog.Info("sink message", slog.String("key", string(msgs[len(msgs)-1].Key))) } } case message := <-claim.Messages(): @@ -127,10 +127,10 @@ func (c *MysqlTableSize) ConsumeClaim(session sarama.ConsumerGroupSession, claim slog.Error("handle message batch", err) time.Sleep(200 * time.Millisecond) } else { + slog.Info("sink message", slog.String("key", string(message.Key))) session.MarkMessage(message, "") items = items[:0] msgs = msgs[:0] - slog.Info("sink message", slog.String("key", string(message.Key))) } } case <-session.Context().Done(): diff --git a/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size_for_doris.go b/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size_for_doris.go index 3bf2ee6d2f..f2332ba913 100644 --- a/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size_for_doris.go +++ b/dbm-services/common/bkdata-kafka-consumer/pkg/consumer/mysql_table_size_for_doris.go @@ -69,10 +69,10 @@ func (c *MysqlTableSizeDoris) ConsumeClaim(session sarama.ConsumerGroupSession, if err := c.HandleMessageTryBatch(items, c.Sinker, c.Db); err != nil { slog.Error("handle message batch", err) } else { + slog.Info("sink message", slog.String("key", string(msgs[len(msgs)-1].Key))) session.MarkMessage(msgs[len(msgs)-1], "") items = items[:0] msgs = msgs[:0] - slog.Info("sink message", slog.String("key", string(msgs[len(msgs)-1].Key))) } } case message := <-claim.Messages(): @@ -104,10 +104,10 @@ func (c *MysqlTableSizeDoris) ConsumeClaim(session sarama.ConsumerGroupSession, slog.Error("handle message batch", err) time.Sleep(200 * time.Millisecond) } else { + slog.Info("sink message", slog.String("key", string(message.Key))) session.MarkMessage(message, "") items = items[:0] msgs = msgs[:0] - slog.Info("sink message", slog.String("key", string(message.Key))) } } case <-session.Context().Done(): diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/mysql-slowlog.json b/dbm-ui/backend/bk_dataview/dashboards/json/mysql-slowlog.json index eb321528a5..947fe3bc05 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/mysql-slowlog.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/mysql-slowlog.json @@ -1,67 +1,4 @@ { - "__inputs": [ - { - "name": "DS_日志平台", - "label": "日志平台", - "description": "", - "type": "datasource", - "pluginId": "bk_log_datasource", - "pluginName": "BlueKing Log TimeSeries" - }, - { - "name": "DS_蓝鲸监控_- 指标数据", - "label": "蓝鲸监控 - 指标数据", - "description": "", - "type": "datasource", - "pluginId": "bkmonitor-timeseries-datasource", - "pluginName": "BlueKing Monitor TimeSeries" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "datasource", - "id": "bk_log_datasource", - "name": "BlueKing Log TimeSeries", - "version": "1.0.0" - }, - { - "type": "datasource", - "id": "bkmonitor-timeseries-datasource", - "name": "BlueKing Monitor TimeSeries", - "version": "3.6.0" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "10.4.10" - }, - { - "type": "panel", - "id": "piechart", - "name": "Pie chart", - "version": "" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - }, - { - "type": "panel", - "id": "xychart", - "name": "XY Chart", - "version": "" - } - ], "annotations": { "list": [ { @@ -87,51 +24,38 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 28404, "links": [], "liveNow": false, "panels": [ + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 17, + "title": "Row title", + "type": "row" + }, { "datasource": { "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, + "description": "慢查询列表", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, "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" + "align": "auto", + "cellOptions": { + "type": "auto" }, - "thresholdsStyle": { - "mode": "off" - } + "filterable": false, + "inspect": false }, "mappings": [], "thresholds": { @@ -148,26 +72,118 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "slow_query.query_digest_md5" + }, + "properties": [ + { + "id": "custom.width", + "value": 248 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "query_time" + }, + "properties": [ + { + "id": "custom.width", + "value": 89 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "rows_examined" + }, + "properties": [ + { + "id": "custom.width", + "value": 109 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "rows_sent" + }, + "properties": [ + { + "id": "custom.width", + "value": 91 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "user" + }, + "properties": [ + { + "id": "custom.width", + "value": 115 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "client_host" + }, + "properties": [ + { + "id": "custom.width", + "value": 124 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "db_name" + }, + "properties": [ + { + "id": "custom.width", + "value": 127 + } + ] + } + ] }, "gridPos": { - "h": 11, - "w": 12, + "h": 8, + "w": 24, "x": 0, - "y": 0 + "y": 1 }, - "id": 13, + "id": 4, "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "rows_sent" + } + ] }, "pluginVersion": "10.4.10", "targets": [ @@ -177,7 +193,83 @@ "conditions": [ [ { - "key": "6mljsz36jp", + "key": "2mxv8t9k0m", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "zgl5rrl1sh", + "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": "6bodoruhm3", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "d1nhrnsuiu", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "rjp12xuc3g", "list": [ { "id": "__ext.cluster_domain", @@ -189,7 +281,7 @@ "value": "__ext.cluster_domain" }, { - "key": "sfx0jgczqa", + "key": "054r8ctv0t", "list": [ { "id": "is", @@ -228,7 +320,7 @@ "value": "is" }, { - "key": "7x205azwki", + "key": "cugj8vah9y", "list": [], "type": "value", "value": [ @@ -238,7 +330,7 @@ ], [ { - "key": "2tvnqkzo08", + "key": "rhgpo7bq3o", "list": [ { "id": "and", @@ -253,19 +345,19 @@ "value": "and" }, { - "key": "keu17lddu4", + "key": "pb0e8ddk04", "list": [ { - "id": "__ext.app", - "name": "__ext.app" + "id": "__ext.instance_role", + "name": "__ext.instance_role" } ], "open": false, "type": "key", - "value": "__ext.app" + "value": "__ext.instance_role" }, { - "key": "lbqdsjbjp1", + "key": "4jlixuj77l", "list": [ { "id": "is", @@ -304,17 +396,17 @@ "value": "is" }, { - "key": "utfu38if9b", + "key": "f2ene6kku7", "list": [], "type": "value", "value": [ - "$app" + "$instance_role" ] } ], [ { - "key": "3a2c8fu72e", + "key": "m1ph76k0pd", "list": [ { "id": "and", @@ -329,7 +421,7 @@ "value": "and" }, { - "key": "l8o1ysejjy", + "key": "ory29m3cn3", "list": [ { "id": "query_time", @@ -341,7 +433,7 @@ "value": "query_time" }, { - "key": "894l21cemo", + "key": "jip8nmotku", "list": [ { "id": "is", @@ -377,22 +469,19 @@ } ], "type": "method", - "value": "gte" + "value": "gt" }, { - "key": "rl49k600e9", + "key": "tnt00a2rfn", "list": [], "type": "value", "value": [ - "3" + "0" ] } ] ], - "dimensions": [ - "slow_query.query_digest_text", - "slow_query.query_digest_md5" - ], + "dimensions": [], "index": { "id": [ "host_process", @@ -404,15 +493,15 @@ ] }, "indexSetString": "", - "method": "sum", - "metric": "query_time", + "method": "logs", + "metric": "bk_host_id", "period": 60, "periodUnitSet": { "periodUnit": "min", "timeNum": 1 }, - "queryString": "", - "size": 10000, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, "target": { "expandKeys": [], "realValues": [], @@ -427,14 +516,104 @@ "refId": "A" } ], - "title": "慢查询语句耗时总和(耗时大于 3 秒)", - "type": "timeseries" - }, - { - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" - }, + "title": "慢查询列表", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "__ext.app": true, + "__ext.app_id": true, + "__ext.bk_cloud_id": true, + "__ext.bk_collect_config_id": true, + "__ext.cluster_domain": true, + "__ext.cluster_name": true, + "__ext.cluster_type": true, + "__ipv6__": true, + "__module__": true, + "__set__": true, + "access_source_host": true, + "bk_host_id": true, + "cloudId": true, + "dtEventTimeStamp": true, + "gseIndex": true, + "index": true, + "iterationIndex": true, + "log": true, + "path": true, + "serverIp": true, + "slow_query.command": true, + "slow_query.db_name": true, + "slow_query.query_length": true, + "sql_timestamp": true + }, + "includeByName": {}, + "indexByName": { + "__ext.app": 21, + "__ext.app_id": 13, + "__ext.bk_cloud_id": 17, + "__ext.bk_collect_config_id": 19, + "__ext.cluster_domain": 22, + "__ext.cluster_name": 15, + "__ext.cluster_type": 16, + "__ext.instance_host": 14, + "__ext.instance_port": 20, + "__ext.instance_role": 18, + "__ipv6__": 37, + "__module__": 35, + "__parse_failure": 39, + "__set__": 36, + "bk_host_id": 23, + "client_host": 5, + "cloudId": 31, + "db_name": 6, + "dtEventTimeStamp": 10, + "gseIndex": 30, + "index": 38, + "iterationIndex": 12, + "lock_time": 32, + "log": 11, + "path": 24, + "query_time": 1, + "rows_examined": 2, + "rows_sent": 3, + "serverIp": 34, + "slow_query.command": 28, + "slow_query.db_name": 25, + "slow_query.query_digest_md5": 7, + "slow_query.query_digest_text": 29, + "slow_query.query_length": 27, + "slow_query.query_string": 9, + "slow_query.table_name": 26, + "sql_text": 8, + "sql_timestamp": 33, + "time": 0, + "user": 4 + }, + "renameByName": {} + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "time" + } + ] + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "description": "慢查询列表", "fieldConfig": { "defaults": { "color": { @@ -457,9 +636,6 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -493,18 +669,23 @@ "overrides": [] }, "gridPos": { - "h": 11, + "h": 10, "w": 12, - "x": 12, - "y": 0 + "x": 0, + "y": 9 }, - "id": 14, + "id": 18, + "interval": "1m", "options": { "legend": { - "calcs": [], - "displayMode": "list", + "calcs": [ + "max" + ], + "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "Max", + "sortDesc": true }, "tooltip": { "mode": "single", @@ -515,23 +696,23 @@ "targets": [ { "data": { - "alias": "", + "alias": "$tag_slow_query.query_digest_md5 ($tag_db_name) >> $tag_slow_query.query_digest_text", "conditions": [ [ { - "key": "6mljsz36jp", + "key": "2mxv8t9k0m", "list": [ { - "id": "__ext.cluster_domain", - "name": "__ext.cluster_domain" + "id": "__ext.app", + "name": "__ext.app" } ], "open": false, "type": "key", - "value": "__ext.cluster_domain" + "value": "__ext.app" }, { - "key": "sfx0jgczqa", + "key": "zgl5rrl1sh", "list": [ { "id": "is", @@ -570,17 +751,17 @@ "value": "is" }, { - "key": "7x205azwki", + "key": "6bodoruhm3", "list": [], "type": "value", "value": [ - "$cluster_domain" + "$app" ] } ], [ { - "key": "2tvnqkzo08", + "key": "d1nhrnsuiu", "list": [ { "id": "and", @@ -595,19 +776,19 @@ "value": "and" }, { - "key": "keu17lddu4", + "key": "rjp12xuc3g", "list": [ { - "id": "__ext.app", - "name": "__ext.app" + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" } ], "open": false, "type": "key", - "value": "__ext.app" + "value": "__ext.cluster_domain" }, { - "key": "lbqdsjbjp1", + "key": "054r8ctv0t", "list": [ { "id": "is", @@ -646,17 +827,17 @@ "value": "is" }, { - "key": "utfu38if9b", + "key": "cugj8vah9y", "list": [], "type": "value", "value": [ - "$app" + "$cluster_domain" ] } ], [ { - "key": "n09de03syo", + "key": "rhgpo7bq3o", "list": [ { "id": "and", @@ -671,19 +852,19 @@ "value": "and" }, { - "key": "4zf65miazl", + "key": "pb0e8ddk04", "list": [ { - "id": "query_time", - "name": "query_time" + "id": "__ext.instance_role", + "name": "__ext.instance_role" } ], "open": false, "type": "key", - "value": "query_time" + "value": "__ext.instance_role" }, { - "key": "qlk3qre0ie", + "key": "4jlixuj77l", "list": [ { "id": "is", @@ -719,21 +900,22 @@ } ], "type": "method", - "value": "gte" + "value": "is" }, { - "key": "t0whuyz5s9", + "key": "f2ene6kku7", "list": [], "type": "value", "value": [ - "3" + "$instance_role" ] } ] ], "dimensions": [ "slow_query.query_digest_text", - "slow_query.query_digest_md5" + "slow_query.query_digest_md5", + "db_name" ], "index": { "id": [ @@ -746,15 +928,15 @@ ] }, "indexSetString": "", - "method": "max", - "metric": "query_time", - "period": 60, + "method": "value_count", + "metric": "rows_examined", + "period": 300, "periodUnitSet": { "periodUnit": "min", - "timeNum": 1 + "timeNum": 5 }, - "queryString": "", - "size": 10000, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, "target": { "expandKeys": [], "realValues": [], @@ -769,7 +951,96 @@ "refId": "A" } ], - "title": "慢查询语句最大耗时(耗时大于 3 秒)", + "title": "慢查询 sql 模式统计 - count", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "__ext.app": true, + "__ext.app_id": true, + "__ext.bk_cloud_id": true, + "__ext.bk_collect_config_id": true, + "__ext.cluster_domain": true, + "__ext.cluster_name": true, + "__ext.cluster_type": true, + "__ipv6__": true, + "__module__": true, + "__set__": true, + "access_source_host": true, + "bk_host_id": true, + "cloudId": true, + "dtEventTimeStamp": true, + "gseIndex": true, + "index": true, + "iterationIndex": true, + "log": true, + "path": true, + "serverIp": true, + "slow_query.command": true, + "slow_query.db_name": true, + "slow_query.query_length": true, + "sql_timestamp": true + }, + "includeByName": {}, + "indexByName": { + "__ext.app": 20, + "__ext.app_id": 12, + "__ext.bk_cloud_id": 16, + "__ext.bk_collect_config_id": 18, + "__ext.cluster_domain": 21, + "__ext.cluster_name": 14, + "__ext.cluster_type": 15, + "__ext.instance_host": 13, + "__ext.instance_port": 19, + "__ext.instance_role": 17, + "__ipv6__": 37, + "__module__": 35, + "__parse_failure": 39, + "__set__": 36, + "bk_host_id": 22, + "client_host": 5, + "cloudId": 31, + "db_name": 6, + "dtEventTimeStamp": 9, + "gseIndex": 30, + "index": 38, + "iterationIndex": 11, + "lock_time": 32, + "log": 10, + "path": 23, + "query_time": 1, + "rows_examined": 2, + "rows_sent": 3, + "serverIp": 34, + "slow_query.command": 27, + "slow_query.db_name": 24, + "slow_query.query_digest_md5": 29, + "slow_query.query_digest_text": 28, + "slow_query.query_length": 26, + "slow_query.query_string": 8, + "slow_query.table_name": 25, + "sql_text": 7, + "sql_timestamp": 33, + "time": 0, + "user": 4 + }, + "renameByName": {} + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "query_time" + } + ] + } + } + ], "type": "timeseries" }, { @@ -777,6 +1048,7 @@ "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, + "description": "慢查询列表", "fieldConfig": { "defaults": { "color": { @@ -827,37 +1099,44 @@ "value": 80 } ] - } + }, + "unit": "short" }, "overrides": [] }, "gridPos": { - "h": 11, - "w": 8, - "x": 0, - "y": 11 + "h": 10, + "w": 12, + "x": 12, + "y": 9 }, - "id": 2, + "id": 19, + "interval": "1m", "options": { "legend": { - "calcs": [], - "displayMode": "list", + "calcs": [ + "max" + ], + "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "Max", + "sortDesc": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.4.10", "targets": [ { "data": { - "alias": "", + "alias": "$tag_slow_query.query_digest_md5 ($tag_db_name) >> $tag_slow_query.query_digest_text", "conditions": [ [ { - "key": "gjwmwtvrmx", + "key": "2mxv8t9k0m", "list": [ { "id": "__ext.app", @@ -869,7 +1148,7 @@ "value": "__ext.app" }, { - "key": "pdsfpb6cb8", + "key": "zgl5rrl1sh", "list": [ { "id": "is", @@ -908,7 +1187,7 @@ "value": "is" }, { - "key": "lab3662usi", + "key": "6bodoruhm3", "list": [], "type": "value", "value": [ @@ -918,7 +1197,7 @@ ], [ { - "key": "dj6pbi2ros", + "key": "d1nhrnsuiu", "list": [ { "id": "and", @@ -933,7 +1212,7 @@ "value": "and" }, { - "key": "9yf3mkfotd", + "key": "rjp12xuc3g", "list": [ { "id": "__ext.cluster_domain", @@ -945,7 +1224,7 @@ "value": "__ext.cluster_domain" }, { - "key": "9g387l3vkz", + "key": "054r8ctv0t", "list": [ { "id": "is", @@ -984,7 +1263,7 @@ "value": "is" }, { - "key": "wl763hj5mr", + "key": "cugj8vah9y", "list": [], "type": "value", "value": [ @@ -994,7 +1273,7 @@ ], [ { - "key": "xvlrd5ao2q", + "key": "rhgpo7bq3o", "list": [ { "id": "and", @@ -1009,7 +1288,7 @@ "value": "and" }, { - "key": "gpic8m9pxh", + "key": "pb0e8ddk04", "list": [ { "id": "__ext.instance_role", @@ -1021,7 +1300,7 @@ "value": "__ext.instance_role" }, { - "key": "qp1pbmnuhj", + "key": "4jlixuj77l", "list": [ { "id": "is", @@ -1060,7 +1339,7 @@ "value": "is" }, { - "key": "xqksksuxcs", + "key": "f2ene6kku7", "list": [], "type": "value", "value": [ @@ -1070,9 +1349,9 @@ ] ], "dimensions": [ - "__ext.instance_host", - "__ext.instance_port", - "__ext.instance_role" + "slow_query.query_digest_text", + "slow_query.query_digest_md5", + "db_name" ], "index": { "id": [ @@ -1085,12 +1364,12 @@ ] }, "indexSetString": "", - "method": "value_count", - "metric": "bk_host_id", - "period": 60, + "method": "sum", + "metric": "rows_examined", + "period": 300, "periodUnitSet": { "periodUnit": "min", - "timeNum": 1 + "timeNum": 5 }, "queryString": "$query_string AND NOT \"# TIME\"", "size": 50, @@ -1108,7 +1387,96 @@ "refId": "A" } ], - "title": "慢查询数量", + "title": "慢查询 sql 模式统计 - rows_examined", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "__ext.app": true, + "__ext.app_id": true, + "__ext.bk_cloud_id": true, + "__ext.bk_collect_config_id": true, + "__ext.cluster_domain": true, + "__ext.cluster_name": true, + "__ext.cluster_type": true, + "__ipv6__": true, + "__module__": true, + "__set__": true, + "access_source_host": true, + "bk_host_id": true, + "cloudId": true, + "dtEventTimeStamp": true, + "gseIndex": true, + "index": true, + "iterationIndex": true, + "log": true, + "path": true, + "serverIp": true, + "slow_query.command": true, + "slow_query.db_name": true, + "slow_query.query_length": true, + "sql_timestamp": true + }, + "includeByName": {}, + "indexByName": { + "__ext.app": 20, + "__ext.app_id": 12, + "__ext.bk_cloud_id": 16, + "__ext.bk_collect_config_id": 18, + "__ext.cluster_domain": 21, + "__ext.cluster_name": 14, + "__ext.cluster_type": 15, + "__ext.instance_host": 13, + "__ext.instance_port": 19, + "__ext.instance_role": 17, + "__ipv6__": 37, + "__module__": 35, + "__parse_failure": 39, + "__set__": 36, + "bk_host_id": 22, + "client_host": 5, + "cloudId": 31, + "db_name": 6, + "dtEventTimeStamp": 9, + "gseIndex": 30, + "index": 38, + "iterationIndex": 11, + "lock_time": 32, + "log": 10, + "path": 23, + "query_time": 1, + "rows_examined": 2, + "rows_sent": 3, + "serverIp": 34, + "slow_query.command": 27, + "slow_query.db_name": 24, + "slow_query.query_digest_md5": 29, + "slow_query.query_digest_text": 28, + "slow_query.query_length": 26, + "slow_query.query_string": 8, + "slow_query.table_name": 25, + "sql_text": 7, + "sql_timestamp": 33, + "time": 0, + "user": 4 + }, + "renameByName": {} + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "query_time" + } + ] + } + } + ], "type": "timeseries" }, { @@ -1116,6 +1484,7 @@ "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, + "description": "慢查询列表", "fieldConfig": { "defaults": { "color": { @@ -1166,37 +1535,44 @@ "value": 80 } ] - } + }, + "unit": "short" }, "overrides": [] }, "gridPos": { - "h": 11, - "w": 8, - "x": 8, - "y": 11 + "h": 9, + "w": 12, + "x": 0, + "y": 19 }, - "id": 10, + "id": 20, + "interval": "1m", "options": { "legend": { - "calcs": [], - "displayMode": "list", + "calcs": [ + "max" + ], + "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "Max", + "sortDesc": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.4.10", "targets": [ { "data": { - "alias": "", + "alias": "$tag_slow_query.query_digest_md5 ($tag_db_name) >> $tag_slow_query.query_digest_text", "conditions": [ [ { - "key": "mi91nl8jg6", + "key": "2mxv8t9k0m", "list": [ { "id": "__ext.app", @@ -1208,7 +1584,7 @@ "value": "__ext.app" }, { - "key": "me8l2ech9x", + "key": "zgl5rrl1sh", "list": [ { "id": "is", @@ -1247,7 +1623,7 @@ "value": "is" }, { - "key": "t6va132nvj", + "key": "6bodoruhm3", "list": [], "type": "value", "value": [ @@ -1257,7 +1633,7 @@ ], [ { - "key": "19smufj0cw", + "key": "d1nhrnsuiu", "list": [ { "id": "and", @@ -1272,7 +1648,7 @@ "value": "and" }, { - "key": "cs2kfob4jx", + "key": "rjp12xuc3g", "list": [ { "id": "__ext.cluster_domain", @@ -1284,7 +1660,7 @@ "value": "__ext.cluster_domain" }, { - "key": "t17dfs5q7u", + "key": "054r8ctv0t", "list": [ { "id": "is", @@ -1323,7 +1699,7 @@ "value": "is" }, { - "key": "6uo1hi1o6g", + "key": "cugj8vah9y", "list": [], "type": "value", "value": [ @@ -1333,7 +1709,7 @@ ], [ { - "key": "wvvswf84pt", + "key": "rhgpo7bq3o", "list": [ { "id": "and", @@ -1348,7 +1724,7 @@ "value": "and" }, { - "key": "u2sf4w6fvm", + "key": "pb0e8ddk04", "list": [ { "id": "__ext.instance_role", @@ -1360,7 +1736,7 @@ "value": "__ext.instance_role" }, { - "key": "lgh3dxh9el", + "key": "4jlixuj77l", "list": [ { "id": "is", @@ -1399,7 +1775,7 @@ "value": "is" }, { - "key": "y2mhhjn3sn", + "key": "f2ene6kku7", "list": [], "type": "value", "value": [ @@ -1408,7 +1784,11 @@ } ] ], - "dimensions": [], + "dimensions": [ + "slow_query.query_digest_text", + "slow_query.query_digest_md5", + "db_name" + ], "index": { "id": [ "host_process", @@ -1420,14 +1800,14 @@ ] }, "indexSetString": "", - "method": "max", - "metric": "query_time", - "period": 60, + "method": "sum", + "metric": "rows_sent", + "period": 300, "periodUnitSet": { "periodUnit": "min", - "timeNum": 1 + "timeNum": 5 }, - "queryString": "", + "queryString": "$query_string AND NOT \"# TIME\"", "size": 50, "target": { "expandKeys": [], @@ -1443,7 +1823,96 @@ "refId": "A" } ], - "title": "慢查询最大耗时", + "title": "慢查询 sql 模式统计 - rows_sent", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "__ext.app": true, + "__ext.app_id": true, + "__ext.bk_cloud_id": true, + "__ext.bk_collect_config_id": true, + "__ext.cluster_domain": true, + "__ext.cluster_name": true, + "__ext.cluster_type": true, + "__ipv6__": true, + "__module__": true, + "__set__": true, + "access_source_host": true, + "bk_host_id": true, + "cloudId": true, + "dtEventTimeStamp": true, + "gseIndex": true, + "index": true, + "iterationIndex": true, + "log": true, + "path": true, + "serverIp": true, + "slow_query.command": true, + "slow_query.db_name": true, + "slow_query.query_length": true, + "sql_timestamp": true + }, + "includeByName": {}, + "indexByName": { + "__ext.app": 20, + "__ext.app_id": 12, + "__ext.bk_cloud_id": 16, + "__ext.bk_collect_config_id": 18, + "__ext.cluster_domain": 21, + "__ext.cluster_name": 14, + "__ext.cluster_type": 15, + "__ext.instance_host": 13, + "__ext.instance_port": 19, + "__ext.instance_role": 17, + "__ipv6__": 37, + "__module__": 35, + "__parse_failure": 39, + "__set__": 36, + "bk_host_id": 22, + "client_host": 5, + "cloudId": 31, + "db_name": 6, + "dtEventTimeStamp": 9, + "gseIndex": 30, + "index": 38, + "iterationIndex": 11, + "lock_time": 32, + "log": 10, + "path": 23, + "query_time": 1, + "rows_examined": 2, + "rows_sent": 3, + "serverIp": 34, + "slow_query.command": 27, + "slow_query.db_name": 24, + "slow_query.query_digest_md5": 29, + "slow_query.query_digest_text": 28, + "slow_query.query_length": 26, + "slow_query.query_string": 8, + "slow_query.table_name": 25, + "sql_text": 7, + "sql_timestamp": 33, + "time": 0, + "user": 4 + }, + "renameByName": {} + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "query_time" + } + ] + } + } + ], "type": "timeseries" }, { @@ -1451,6 +1920,7 @@ "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, + "description": "慢查询列表", "fieldConfig": { "defaults": { "color": { @@ -1501,37 +1971,44 @@ "value": 80 } ] - } + }, + "unit": "dtdurations" }, "overrides": [] }, "gridPos": { - "h": 11, - "w": 8, - "x": 16, - "y": 11 + "h": 9, + "w": 12, + "x": 12, + "y": 19 }, - "id": 11, + "id": 21, + "interval": "1m", "options": { "legend": { - "calcs": [], - "displayMode": "list", + "calcs": [ + "max" + ], + "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "Max", + "sortDesc": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.4.10", "targets": [ { "data": { - "alias": "", + "alias": "$tag_slow_query.query_digest_md5 ($tag_db_name) >> $tag_slow_query.query_digest_text", "conditions": [ [ { - "key": "mi91nl8jg6", + "key": "2mxv8t9k0m", "list": [ { "id": "__ext.app", @@ -1543,7 +2020,7 @@ "value": "__ext.app" }, { - "key": "me8l2ech9x", + "key": "zgl5rrl1sh", "list": [ { "id": "is", @@ -1582,7 +2059,7 @@ "value": "is" }, { - "key": "t6va132nvj", + "key": "6bodoruhm3", "list": [], "type": "value", "value": [ @@ -1592,7 +2069,7 @@ ], [ { - "key": "19smufj0cw", + "key": "d1nhrnsuiu", "list": [ { "id": "and", @@ -1607,7 +2084,7 @@ "value": "and" }, { - "key": "cs2kfob4jx", + "key": "rjp12xuc3g", "list": [ { "id": "__ext.cluster_domain", @@ -1619,7 +2096,7 @@ "value": "__ext.cluster_domain" }, { - "key": "t17dfs5q7u", + "key": "054r8ctv0t", "list": [ { "id": "is", @@ -1658,7 +2135,7 @@ "value": "is" }, { - "key": "6uo1hi1o6g", + "key": "cugj8vah9y", "list": [], "type": "value", "value": [ @@ -1668,7 +2145,7 @@ ], [ { - "key": "3eetndscqx", + "key": "rhgpo7bq3o", "list": [ { "id": "and", @@ -1683,7 +2160,7 @@ "value": "and" }, { - "key": "8g2gu2426k", + "key": "pb0e8ddk04", "list": [ { "id": "__ext.instance_role", @@ -1695,7 +2172,7 @@ "value": "__ext.instance_role" }, { - "key": "gzpyfg0mjd", + "key": "4jlixuj77l", "list": [ { "id": "is", @@ -1734,7 +2211,7 @@ "value": "is" }, { - "key": "tcg9jdati2", + "key": "f2ene6kku7", "list": [], "type": "value", "value": [ @@ -1743,7 +2220,11 @@ } ] ], - "dimensions": [], + "dimensions": [ + "slow_query.query_digest_text", + "slow_query.query_digest_md5", + "db_name" + ], "index": { "id": [ "host_process", @@ -1755,14 +2236,14 @@ ] }, "indexSetString": "", - "method": "avg", + "method": "sum", "metric": "query_time", - "period": 60, + "period": 300, "periodUnitSet": { "periodUnit": "min", - "timeNum": 1 + "timeNum": 5 }, - "queryString": "", + "queryString": "$query_string AND NOT \"# TIME\"", "size": 50, "target": { "expandKeys": [], @@ -1778,1358 +2259,3157 @@ "refId": "A" } ], - "title": "慢查询平均耗时", + "title": "慢查询 sql 模式统计 - query_time", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "__ext.app": true, + "__ext.app_id": true, + "__ext.bk_cloud_id": true, + "__ext.bk_collect_config_id": true, + "__ext.cluster_domain": true, + "__ext.cluster_name": true, + "__ext.cluster_type": true, + "__ipv6__": true, + "__module__": true, + "__set__": true, + "access_source_host": true, + "bk_host_id": true, + "cloudId": true, + "dtEventTimeStamp": true, + "gseIndex": true, + "index": true, + "iterationIndex": true, + "log": true, + "path": true, + "serverIp": true, + "slow_query.command": true, + "slow_query.db_name": true, + "slow_query.query_length": true, + "sql_timestamp": true + }, + "includeByName": {}, + "indexByName": { + "__ext.app": 20, + "__ext.app_id": 12, + "__ext.bk_cloud_id": 16, + "__ext.bk_collect_config_id": 18, + "__ext.cluster_domain": 21, + "__ext.cluster_name": 14, + "__ext.cluster_type": 15, + "__ext.instance_host": 13, + "__ext.instance_port": 19, + "__ext.instance_role": 17, + "__ipv6__": 37, + "__module__": 35, + "__parse_failure": 39, + "__set__": 36, + "bk_host_id": 22, + "client_host": 5, + "cloudId": 31, + "db_name": 6, + "dtEventTimeStamp": 9, + "gseIndex": 30, + "index": 38, + "iterationIndex": 11, + "lock_time": 32, + "log": 10, + "path": 23, + "query_time": 1, + "rows_examined": 2, + "rows_sent": 3, + "serverIp": 34, + "slow_query.command": 27, + "slow_query.db_name": 24, + "slow_query.query_digest_md5": 29, + "slow_query.query_digest_text": 28, + "slow_query.query_length": 26, + "slow_query.query_string": 8, + "slow_query.table_name": 25, + "sql_text": 7, + "sql_timestamp": 33, + "time": 0, + "user": 4 + }, + "renameByName": {} + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "query_time" + } + ] + } + } + ], "type": "timeseries" }, { - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "id": 16, + "panels": [ + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } }, - "mappings": [] - }, - "overrides": [] - }, - "gridPos": { - "h": 13, - "w": 12, - "x": 0, - "y": 22 - }, - "id": 6, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" + "pluginVersion": "10.4.10", + "targets": [ + { + "data": { + "alias": "$tag_slow_query.query_digest_text", + "conditions": [ + [ + { + "key": "6mljsz36jp", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "sfx0jgczqa", + "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": "7x205azwki", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] + } + ], + [ + { + "key": "2tvnqkzo08", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "keu17lddu4", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "lbqdsjbjp1", + "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": "utfu38if9b", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "3a2c8fu72e", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "l8o1ysejjy", + "list": [ + { + "id": "query_time", + "name": "query_time" + } + ], + "open": false, + "type": "key", + "value": "query_time" + }, + { + "key": "894l21cemo", + "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": "gte" + }, + { + "key": "rl49k600e9", + "list": [], + "type": "value", + "value": [ + "3" + ] + } + ] + ], + "dimensions": [ + "slow_query.query_digest_text", + "slow_query.query_digest_md5", + "user" + ], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] + }, + "indexSetString": "", + "method": "sum", + "metric": "query_time", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "", + "size": 10000, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } ], - "fields": "", - "values": false + "title": "慢查询语句耗时总和(耗时大于 3 秒)", + "type": "timeseries" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ { - "data": { - "alias": "", - "conditions": [ - [ - { - "key": "cd62omqqjg", - "list": [ - { - "id": "__ext.app", - "name": "__ext.app" + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "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", + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 26 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.10", + "targets": [ + { + "data": { + "alias": "$tag_slow_query.query_digest_text", + "conditions": [ + [ + { + "key": "6mljsz36jp", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "sfx0jgczqa", + "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": "7x205azwki", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] } ], - "open": false, - "type": "key", - "value": "__ext.app" + [ + { + "key": "2tvnqkzo08", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "keu17lddu4", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "lbqdsjbjp1", + "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": "utfu38if9b", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "n09de03syo", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "4zf65miazl", + "list": [ + { + "id": "query_time", + "name": "query_time" + } + ], + "open": false, + "type": "key", + "value": "query_time" + }, + { + "key": "qlk3qre0ie", + "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": "gte" + }, + { + "key": "t0whuyz5s9", + "list": [], + "type": "value", + "value": [ + "3" + ] + } + ] + ], + "dimensions": [ + "slow_query.query_digest_text", + "slow_query.query_digest_md5", + "user" + ], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] }, - { - "key": "5a54d4ddtb", - "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" + "indexSetString": "", + "method": "max", + "metric": "query_time", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 }, - { - "key": "bfwsce6lak", - "list": [], - "type": "value", - "value": [ - "$app" - ] + "queryString": "", + "size": 10000, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ], - [ - { - "key": "fsk3zn8o6c", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" - } - ], - "type": "condition", - "value": "and" + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询语句最大耗时(耗时大于 3 秒)", + "type": "timeseries" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "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 }, - { - "key": "5w1pk5lg3f", - "list": [ - { - "id": "__ext.cluster_domain", - "name": "__ext.cluster_domain" - } - ], - "open": false, - "type": "key", - "value": "__ext.cluster_domain" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - { - "key": "83yxhj8nw3", - "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" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - { - "key": "xaj59hptrb", - "list": [], - "type": "value", - "value": [ - "$cluster_domain" - ] + "thresholdsStyle": { + "mode": "off" } - ], - [ - { - "key": "dn819uw8fx", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "value_count(_index){__ext.instance_host=x.x.x.x, __ext.instance_port=20000, __ext.instance_role=backend_master}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 8, + "x": 0, + "y": 37 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "gjwmwtvrmx", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "pdsfpb6cb8", + "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": "lab3662usi", + "list": [], + "type": "value", + "value": [ + "$app" + ] } ], - "type": "condition", - "value": "and" - }, - { - "key": "k7xyundq1h", - "list": [ - { - "id": "__ext.instance_role", - "name": "__ext.instance_role" + [ + { + "key": "dj6pbi2ros", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "9yf3mkfotd", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "9g387l3vkz", + "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": "wl763hj5mr", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] } ], - "open": false, - "type": "key", - "value": "__ext.instance_role" - }, - { - "key": "du8wyo9d0f", - "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": "<=" + [ + { + "key": "xvlrd5ao2q", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "gpic8m9pxh", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "qp1pbmnuhj", + "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": "xqksksuxcs", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] } + ] + ], + "dimensions": [ + "__ext.instance_host", + "__ext.instance_port", + "__ext.instance_role" + ], + "index": { + "id": [ + "host_process", + 5913 ], - "type": "method", - "value": "is" - }, - { - "key": "qdgkqxdik9", - "list": [], - "type": "value", - "value": [ - "$instance_role" + "labels": [ + "进程", + "[采集项]mysql_slowlog" ] + }, + "indexSetString": "", + "method": "value_count", + "metric": "bk_host_id", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ] - ], - "dimensions": [ - "slow_query.query_digest_text", - "slow_query.query_digest_md5" - ], - "index": { - "id": [ - "host_process", - 5913 - ], - "labels": [ - "进程", - "[采集项]mysql_slowlog" - ] - }, - "indexSetString": "", - "method": "value_count", - "metric": "bk_host_id", - "period": 86400, - "periodUnitSet": { - "periodUnit": "min", - "timeNum": 1440 - }, - "queryString": "$query_string AND NOT \"# TIME\"", - "size": 50, - "target": { - "expandKeys": [], - "realValues": [], - "treeData": [], - "values": [] + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" } - }, + ], + "title": "慢查询数量", + "type": "timeseries" + }, + { "datasource": { "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, - "refId": "A" - } - ], - "title": "慢查询模式分布", - "type": "piechart" - }, - { - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [] - }, - "overrides": [] - }, - "gridPos": { - "h": 13, - "w": 12, - "x": 12, - "y": 22 - }, - "id": 8, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "data": { - "alias": "", - "conditions": [ - [ - { - "key": "cd62omqqjg", - "list": [ - { - "id": "__ext.app", - "name": "__ext.app" - } - ], - "open": false, - "type": "key", - "value": "__ext.app" - }, - { - "key": "5a54d4ddtb", - "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": "bfwsce6lak", - "list": [], - "type": "value", - "value": [ - "$app" - ] - } - ], - [ - { - "key": "fsk3zn8o6c", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" - } - ], - "type": "condition", - "value": "and" - }, - { - "key": "5w1pk5lg3f", - "list": [ - { - "id": "__ext.cluster_domain", - "name": "__ext.cluster_domain" - } - ], - "open": false, - "type": "key", - "value": "__ext.cluster_domain" - }, - { - "key": "83yxhj8nw3", - "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": "xaj59hptrb", - "list": [], - "type": "value", - "value": [ - "$cluster_domain" - ] - } - ], - [ - { - "key": "rjwgqy7sl6", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" - } - ], - "type": "condition", - "value": "and" + "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 }, - { - "key": "aiuw43h333", - "list": [ - { - "id": "__ext.instance_role", - "name": "__ext.instance_role" - } - ], - "open": false, - "type": "key", - "value": "__ext.instance_role" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - { - "key": "ylo17atfvg", - "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" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - { - "key": "g25nspnms1", - "list": [], - "type": "value", - "value": [ - "$instance_role" - ] + "thresholdsStyle": { + "mode": "off" } - ] - ], - "dimensions": [ - "db_name", - "slow_query.table_name" - ], - "index": { - "id": [ - "host_process", - 5913 - ], - "labels": [ - "进程", - "[采集项]mysql_slowlog" - ] - }, - "indexSetString": "", - "method": "value_count", - "metric": "bk_host_id", - "period": 86400, - "periodUnitSet": { - "periodUnit": "min", - "timeNum": 1440 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "queryString": "$query_string AND NOT \"# TIME\"", - "size": 50, - "target": { - "expandKeys": [], - "realValues": [], - "treeData": [], - "values": [] - } + "overrides": [] }, - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" + "gridPos": { + "h": 11, + "w": 8, + "x": 8, + "y": 37 }, - "refId": "A" - } - ], - "title": "慢查询库表分布", - "type": "piechart" - }, - { - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "pointSize": { - "fixed": 3 - }, - "scaleDistribution": { - "type": "linear" - }, - "show": "points" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 24, - "x": 0, - "y": 35 - }, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "series": [ - { - "x": "time", - "y": "query_time" - } - ], - "seriesMapping": "manual", - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "10.4.10", - "targets": [ - { - "data": { - "alias": "", - "conditions": [ - [ - { - "key": "6mljsz36jp", - "list": [ - { - "id": "__ext.cluster_domain", - "name": "__ext.cluster_domain" - } - ], - "open": false, - "type": "key", - "value": "__ext.cluster_domain" - }, - { - "key": "sfx0jgczqa", - "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": "7x205azwki", - "list": [], - "type": "value", - "value": [ - "$cluster_domain" - ] - } - ], - [ - { - "key": "2tvnqkzo08", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" - } - ], - "type": "condition", - "value": "and" - }, - { - "key": "keu17lddu4", - "list": [ - { - "id": "__ext.app", - "name": "__ext.app" - } - ], - "open": false, - "type": "key", - "value": "__ext.app" - }, - { - "key": "lbqdsjbjp1", - "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": "utfu38if9b", - "list": [], - "type": "value", - "value": [ - "$app" - ] - } - ], - [ - { - "key": "nh2ut2m0kn", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" - } - ], - "type": "condition", - "value": "and" - }, - { - "key": "t8pcdqa8ur", - "list": [ - { - "id": "query_time", - "name": "query_time" - } - ], - "open": false, - "type": "key", - "value": "query_time" - }, - { - "key": "pn0nx5wi7t", - "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": "gt" - }, - { - "key": "c6fh1ifof0", - "list": [], - "type": "value", - "value": [ - "3" - ] - } - ] - ], - "dimensions": [], - "index": { - "id": [ - "host_process", - 5913 - ], - "labels": [ - "进程", - "[采集项]mysql_slowlog" - ] - }, - "indexSetString": "", - "method": "logs", - "metric": "query_time", - "period": 60, - "periodUnitSet": { - "periodUnit": "min", - "timeNum": 1 + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "queryString": "", - "size": 10000, - "target": { - "expandKeys": [], - "realValues": [], - "treeData": [], - "values": [] + "tooltip": { + "mode": "single", + "sort": "none" } }, + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "mi91nl8jg6", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "me8l2ech9x", + "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": "t6va132nvj", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "19smufj0cw", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "cs2kfob4jx", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "t17dfs5q7u", + "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": "6uo1hi1o6g", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] + } + ], + [ + { + "key": "wvvswf84pt", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "u2sf4w6fvm", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "lgh3dxh9el", + "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": "y2mhhjn3sn", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] + } + ] + ], + "dimensions": [], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] + }, + "indexSetString": "", + "method": "max", + "metric": "query_time", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询最大耗时", + "type": "timeseries" + }, + { "datasource": { "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, - "refId": "A" - } - ], - "title": "慢查询耗散点图(耗时大于 3 秒)", - "type": "xychart" - }, - { - "datasource": { - "type": "bk_log_datasource", - "uid": "${DS_日志平台}" - }, - "description": "慢查询列表", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" + "gridPos": { + "h": 11, + "w": 8, + "x": 16, + "y": 37 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "filterable": false, - "inspect": false + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 24, - "x": 0, - "y": 47 - }, - "id": 4, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "__ext.instance_role" - } - ] - }, - "pluginVersion": "10.4.10", - "targets": [ - { - "data": { - "alias": "", - "conditions": [ - [ - { - "key": "2mxv8t9k0m", - "list": [ - { - "id": "__ext.app", - "name": "__ext.app" + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "mi91nl8jg6", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "me8l2ech9x", + "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": "t6va132nvj", + "list": [], + "type": "value", + "value": [ + "$app" + ] } ], - "open": false, - "type": "key", - "value": "__ext.app" - }, - { - "key": "zgl5rrl1sh", - "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": "<=" + [ + { + "key": "19smufj0cw", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "cs2kfob4jx", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "t17dfs5q7u", + "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": "6uo1hi1o6g", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] } ], - "type": "method", - "value": "is" - }, - { - "key": "6bodoruhm3", - "list": [], - "type": "value", - "value": [ - "$app" + [ + { + "key": "3eetndscqx", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "8g2gu2426k", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "gzpyfg0mjd", + "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": "tcg9jdati2", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] + } + ] + ], + "dimensions": [], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" ] + }, + "indexSetString": "", + "method": "avg", + "metric": "query_time", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询平均耗时", + "type": "timeseries" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 8, + "x": 0, + "y": 48 + }, + "id": 6, + "options": { + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - [ - { - "key": "d1nhrnsuiu", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "data": { + "alias": "$tag_slow_query.query_digest_text", + "conditions": [ + [ + { + "key": "cd62omqqjg", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "5a54d4ddtb", + "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": "bfwsce6lak", + "list": [], + "type": "value", + "value": [ + "$app" + ] } ], - "type": "condition", - "value": "and" - }, - { - "key": "rjp12xuc3g", - "list": [ - { - "id": "__ext.cluster_domain", - "name": "__ext.cluster_domain" + [ + { + "key": "fsk3zn8o6c", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "5w1pk5lg3f", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "83yxhj8nw3", + "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": "xaj59hptrb", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] } ], - "open": false, - "type": "key", - "value": "__ext.cluster_domain" - }, - { - "key": "054r8ctv0t", - "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": "<=" + [ + { + "key": "dn819uw8fx", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "k7xyundq1h", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "du8wyo9d0f", + "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": "qdgkqxdik9", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] } + ] + ], + "dimensions": [ + "slow_query.query_digest_text", + "slow_query.query_digest_md5" + ], + "index": { + "id": [ + "host_process", + 5913 ], - "type": "method", - "value": "is" - }, - { - "key": "cugj8vah9y", - "list": [], - "type": "value", - "value": [ - "$cluster_domain" + "labels": [ + "进程", + "[采集项]mysql_slowlog" ] + }, + "indexSetString": "", + "method": "value_count", + "metric": "bk_host_id", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询模式分布", + "type": "piechart" + }, + { + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 8, + "x": 8, + "y": 48 + }, + "id": 8, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - [ - { - "key": "rhgpo7bq3o", - "list": [ - { - "id": "and", - "name": "AND" - }, - { - "id": "or", - "name": "OR" + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "cd62omqqjg", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "5a54d4ddtb", + "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": "bfwsce6lak", + "list": [], + "type": "value", + "value": [ + "$app" + ] } ], - "type": "condition", - "value": "and" - }, - { - "key": "pb0e8ddk04", - "list": [ - { - "id": "__ext.instance_role", - "name": "__ext.instance_role" + [ + { + "key": "fsk3zn8o6c", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "5w1pk5lg3f", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "83yxhj8nw3", + "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": "xaj59hptrb", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] } ], - "open": false, - "type": "key", - "value": "__ext.instance_role" - }, - { - "key": "4jlixuj77l", - "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": "<=" + [ + { + "key": "rjwgqy7sl6", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "aiuw43h333", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "ylo17atfvg", + "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": "g25nspnms1", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] } + ] + ], + "dimensions": [ + "db_name", + "slow_query.table_name" + ], + "index": { + "id": [ + "host_process", + 5913 ], - "type": "method", - "value": "is" - }, - { - "key": "f2ene6kku7", - "list": [], - "type": "value", - "value": [ - "$instance_role" + "labels": [ + "进程", + "[采集项]mysql_slowlog" ] + }, + "indexSetString": "", + "method": "value_count", + "metric": "bk_host_id", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] } - ] - ], - "dimensions": [], - "index": { - "id": [ - "host_process", - 5913 - ], - "labels": [ - "进程", - "[采集项]mysql_slowlog" - ] - }, - "indexSetString": "", - "method": "logs", - "metric": "bk_host_id", - "period": 60, - "periodUnitSet": { - "periodUnit": "min", - "timeNum": 1 - }, - "queryString": "$query_string AND NOT \"# TIME\"", - "size": 50, - "target": { - "expandKeys": [], - "realValues": [], - "treeData": [], - "values": [] + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" } - }, + ], + "title": "慢查询库表分布", + "type": "piechart" + }, + { "datasource": { "type": "bk_log_datasource", "uid": "${DS_日志平台}" }, - "refId": "A" - } - ], - "title": "慢查询列表", - "transformations": [ - { - "id": "organize", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 8, + "x": 16, + "y": 48 + }, + "id": 15, "options": { - "excludeByName": { - "__ext.app": true, - "__ext.app_id": true, - "__ext.bk_cloud_id": true, - "__ext.bk_collect_config_id": true, - "__ext.cluster_domain": true, - "__ext.cluster_name": true, - "__ext.cluster_type": true, - "__ipv6__": true, - "__module__": true, - "__set__": true, - "access_source_host": true, - "bk_host_id": true, - "cloudId": true, - "dtEventTimeStamp": true, - "gseIndex": true, - "index": true, - "iterationIndex": true, - "log": false, - "path": true, - "serverIp": true, - "slow_query.db_name": true + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "indexByName": { - "__ext.app": 16, - "__ext.app_id": 8, - "__ext.bk_cloud_id": 12, - "__ext.bk_collect_config_id": 14, - "__ext.cluster_domain": 17, - "__ext.cluster_name": 10, - "__ext.cluster_type": 11, - "__ext.instance_host": 9, - "__ext.instance_port": 15, - "__ext.instance_role": 13, - "__ipv6__": 37, - "__module__": 35, - "__set__": 36, - "access_source_host": 20, - "bk_host_id": 18, - "cloudId": 30, - "db_name": 22, - "dtEventTimeStamp": 5, - "gseIndex": 29, - "index": 38, - "iterationIndex": 7, - "lock_time": 31, - "log": 6, - "path": 19, - "query_time": 1, - "rows_examined": 2, - "rows_sent": 3, - "serverIp": 34, - "slow_query.command": 25, - "slow_query.db_name": 28, - "slow_query.query_digest_md5": 27, - "slow_query.query_digest_text": 26, - "slow_query.query_length": 24, - "slow_query.query_string": 4, - "slow_query.table_name": 23, - "sql_text": 32, - "sql_timestamp": 33, - "time": 0, - "user": 21 + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "renameByName": {} - } + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "cd62omqqjg", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "5a54d4ddtb", + "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": "bfwsce6lak", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "fsk3zn8o6c", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "5w1pk5lg3f", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "83yxhj8nw3", + "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": "xaj59hptrb", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] + } + ], + [ + { + "key": "rjwgqy7sl6", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "aiuw43h333", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "ylo17atfvg", + "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": "g25nspnms1", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] + } + ] + ], + "dimensions": [ + "user" + ], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] + }, + "indexSetString": "", + "method": "value_count", + "metric": "bk_host_id", + "period": 86400, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1440 + }, + "queryString": "$query_string AND NOT \"# TIME\"", + "size": 50, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询数量用户分布", + "type": "piechart" }, { - "id": "sortBy", + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "pointSize": { + "fixed": 3 + }, + "scaleDistribution": { + "type": "linear" + }, + "show": "points" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 63 + }, + "id": 12, "options": { - "fields": {}, - "sort": [ + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "series": [ { - "desc": true, - "field": "query_time" + "x": "time", + "y": "query_time" } - ] - } + ], + "seriesMapping": "manual", + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.10", + "targets": [ + { + "data": { + "alias": "", + "conditions": [ + [ + { + "key": "6mljsz36jp", + "list": [ + { + "id": "__ext.cluster_domain", + "name": "__ext.cluster_domain" + } + ], + "open": false, + "type": "key", + "value": "__ext.cluster_domain" + }, + { + "key": "sfx0jgczqa", + "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": "7x205azwki", + "list": [], + "type": "value", + "value": [ + "$cluster_domain" + ] + } + ], + [ + { + "key": "2tvnqkzo08", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "keu17lddu4", + "list": [ + { + "id": "__ext.app", + "name": "__ext.app" + } + ], + "open": false, + "type": "key", + "value": "__ext.app" + }, + { + "key": "lbqdsjbjp1", + "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": "utfu38if9b", + "list": [], + "type": "value", + "value": [ + "$app" + ] + } + ], + [ + { + "key": "nh2ut2m0kn", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "t8pcdqa8ur", + "list": [ + { + "id": "query_time", + "name": "query_time" + } + ], + "open": false, + "type": "key", + "value": "query_time" + }, + { + "key": "pn0nx5wi7t", + "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": "gt" + }, + { + "key": "c6fh1ifof0", + "list": [], + "type": "value", + "value": [ + "3" + ] + } + ], + [ + { + "key": "bypr4vy8yl", + "list": [ + { + "id": "and", + "name": "AND" + }, + { + "id": "or", + "name": "OR" + } + ], + "type": "condition", + "value": "and" + }, + { + "key": "xkc2tq74po", + "list": [ + { + "id": "__ext.instance_role", + "name": "__ext.instance_role" + } + ], + "open": false, + "type": "key", + "value": "__ext.instance_role" + }, + { + "key": "iri8of8ast", + "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": "xe6sjh7mko", + "list": [], + "type": "value", + "value": [ + "$instance_role" + ] + } + ] + ], + "dimensions": [], + "index": { + "id": [ + "host_process", + 5913 + ], + "labels": [ + "进程", + "[采集项]mysql_slowlog" + ] + }, + "indexSetString": "", + "method": "logs", + "metric": "query_time", + "period": 60, + "periodUnitSet": { + "periodUnit": "min", + "timeNum": 1 + }, + "queryString": "", + "size": 10000, + "target": { + "expandKeys": [], + "realValues": [], + "treeData": [], + "values": [] + } + }, + "datasource": { + "type": "bk_log_datasource", + "uid": "${DS_日志平台}" + }, + "refId": "A" + } + ], + "title": "慢查询耗散点图(耗时大于 3 秒)", + "type": "xychart" } ], - "type": "table" + "title": "Row title", + "type": "row" } ], + "refresh": "", "schemaVersion": 39, "tags": [ "tendbsingle", @@ -3140,14 +5420,10 @@ "templating": { "list": [ { - "current": { - "selected": true, - "text": "bk", - "value": "bk" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -3176,14 +5452,10 @@ "type": "query" }, { - "current": { - "selected": true, - "text": "gamedb.bkmonitor.bk.db", - "value": "gamedb.bkmonitor.bk.db" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -3220,14 +5492,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "backend_master", - "value": "backend_master" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -3265,23 +5533,14 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "*", - "value": "*" - }, + "current": {}, "hide": 0, "name": "query_string", - "options": [ - { - "selected": true, - "text": "*", - "value": "*" - } - ], + "options": [], "query": "*", "skipUrlSync": false, - "type": "textbox" + "type": "textbox", + "refresh": 1 } ] }, @@ -3292,7 +5551,36 @@ "timepicker": {}, "timezone": "default", "title": "MySQL慢查询", - "uid": "T03zLYLSz", - "version": 33, - "weekStart": "" + "version": 45, + "weekStart": "", + "__inputs": [ + { + "name": "DS_蓝鲸监控_-_指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "蓝鲸监控 - 指标数据" + }, + { + "name": "DS_日志平台", + "label": "日志平台", + "description": "", + "type": "datasource", + "pluginId": "bk_log_datasource", + "pluginName": "日志平台" + } + ], + "__requires": [ + { + "type": "datasource", + "id": "bk_log_datasource", + "name": "日志平台" + }, + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "蓝鲸监控 - 指标数据" + } + ] } \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster-table.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster-table.json index 92766182eb..66ab57c47b 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster-table.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster-table.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 44238, "links": [], "liveNow": false, "panels": [ @@ -36,136 +35,15 @@ "x": 0, "y": 0 }, - "id": 115, + "id": 116, "panels": [], - "title": "Database=$dbname", + "title": "Table=$tbname", "type": "row" }, { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 114, - "interval": "1d", - "options": { - "displayLabels": [ - "percent" - ], - "legend": { - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "values": [ - "value" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "dataset": "__internal_schema", - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour, database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=10\nORDER BY dteventtimehour", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "dataset": "__internal_schema", - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT dteventtimehour, \"_OTHER._OTHER\" as metric, sum(value) as \"_OTHER._OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking >10\nGROUP BY dteventtimehour", - "refId": "B", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "timeFrom": "2d", - "title": "Table Size Top20 for db=$dbname", - "type": "piechart" - }, - { - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -223,12 +101,12 @@ "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, - "x": 12, + "h": 6, + "w": 24, + "x": 0, "y": 1 }, - "id": 113, + "id": 112, "interval": "1d", "options": { "legend": { @@ -236,7 +114,7 @@ "lastNotNull" ], "displayMode": "table", - "placement": "bottom", + "placement": "right", "showLegend": true }, "tooltip": { @@ -246,15 +124,15 @@ }, "targets": [ { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", "rawQuery": true, - "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric ,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n table_name in (${tbname:sqlstring}) AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", "refId": "A", "sql": { "columns": [ @@ -275,137 +153,259 @@ } } ], - "title": "Table Size for db=$dbname", + "title": "Table Size", "type": "timeseries" }, { - "collapsed": false, + "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 7 }, - "id": 116, - "panels": [], - "title": "Table=$tbname", - "type": "row" - }, - { - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "id": 115, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, - "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 + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "bytes" }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 114, + "interval": "1d", + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "value" + ] }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "multi", + "sort": "desc" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, - { - "color": "red", - "value": 80 + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour, database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=10\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 12 - }, - "id": 112, - "interval": "1d", - "options": { - "legend": { - "calcs": [ - "lastNotNull" + }, + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT dteventtimehour, \"_OTHER._OTHER\" as metric, sum(value) as \"_OTHER._OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking >10\nGROUP BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "timeFrom": "2d", + "title": "Table Size Top20 for db=$dbname", + "type": "piechart" }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ { - "dataset": "__internal_schema", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric ,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n table_name in ($tbname) AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "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 }, - "type": "groupBy" + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 113, + "interval": "1d", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 } - ], - "limit": 50 - } + } + ], + "title": "Table Size for db=$dbname", + "type": "timeseries" } ], - "title": "Table Size", - "type": "timeseries" + "title": "Database=$dbname", + "type": "row" }, { "collapsed": true, @@ -413,14 +413,14 @@ "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 8 }, "id": 22, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -432,7 +432,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -444,7 +445,7 @@ "h": 5, "w": 3, "x": 0, - "y": 19 + "y": 9 }, "hideTimeOverride": true, "id": 111, @@ -470,7 +471,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -497,7 +498,7 @@ "method": "SUM", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -528,7 +529,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -555,7 +556,7 @@ "method": "SUM", "metric_field": "mysql_datadir_df_total_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -584,13 +585,13 @@ } ], "timeFrom": "24h", - "title": "Datasize (remote_master)", + "title": "Datadir Used du", "type": "gauge" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -602,7 +603,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -618,7 +620,7 @@ "h": 5, "w": 3, "x": 3, - "y": 19 + "y": 9 }, "hideTimeOverride": true, "id": 14, @@ -645,7 +647,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -668,7 +670,7 @@ "method": "MAX", "metric_field": "mysql_datadir_df_usage", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -697,13 +699,13 @@ } ], "timeFrom": "24h", - "title": "Capacity Used (remote_master)", + "title": "Datadir Usage", "type": "gauge" }, { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -726,7 +728,7 @@ "h": 10, "w": 9, "x": 6, - "y": 19 + "y": 9 }, "id": 117, "interval": "1d", @@ -757,10 +759,10 @@ }, "targets": [ { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -787,10 +789,10 @@ } }, { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "table", @@ -823,7 +825,7 @@ { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -867,7 +869,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -883,7 +886,7 @@ "h": 10, "w": 9, "x": 15, - "y": 19 + "y": 9 }, "id": 118, "interval": "1d", @@ -903,10 +906,10 @@ }, "targets": [ { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -938,7 +941,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -983,7 +986,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -998,7 +1002,7 @@ "h": 5, "w": 6, "x": 0, - "y": 24 + "y": 14 }, "id": 11, "options": { @@ -1021,7 +1025,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1082,7 +1086,7 @@ { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -1126,7 +1130,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1142,7 +1147,7 @@ "h": 6, "w": 24, "x": 0, - "y": 29 + "y": 19 }, "id": 119, "interval": "1d", @@ -1162,10 +1167,10 @@ }, "targets": [ { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -1191,10 +1196,10 @@ } }, { - "dataset": "__internal_schema", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "table", @@ -1234,14 +1239,14 @@ "h": 1, "w": 24, "x": 0, - "y": 19 + "y": 9 }, "id": 70, "panels": [ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1288,7 +1293,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1304,7 +1310,7 @@ "h": 7, "w": 12, "x": 0, - "y": 20 + "y": 26 }, "id": 65, "interval": "2h", @@ -1325,7 +1331,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1352,7 +1358,7 @@ "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1380,14 +1386,13 @@ "type": "range" } ], - "timeFrom": "7d", "title": "datadir Size by Shard Instance", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1431,7 +1436,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1447,7 +1453,7 @@ "h": 7, "w": 12, "x": 12, - "y": 20 + "y": 26 }, "id": 84, "interval": "2h", @@ -1468,7 +1474,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "HVlyYOe4z" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1495,7 +1501,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1533,7 +1539,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_total_mb", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1561,8 +1567,7 @@ "type": "range" } ], - "timeFrom": "7d", - "title": "disk partition space by host", + "title": "Datadir size for df partition", "type": "timeseries" } ], @@ -1573,19 +1578,16 @@ "refresh": false, "schemaVersion": 39, "tags": [ - "tendbcluster" + "tendbcluster", + "表容量视图" ], "templating": { "list": [ { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -1615,14 +1617,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "P3XSxkgSz" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -1668,14 +1666,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "definition": "select distinct database_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \ndteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000", "hide": 0, @@ -1692,18 +1686,10 @@ "type": "query" }, { - "current": { - "selected": true, - "text": [ - "bcs_lol_cap_progression_metrics_132" - ], - "value": [ - "bcs_lol_cap_progression_metrics_132" - ] - }, + "current": {}, "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "definition": "select distinct table_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \n database_name = '$dbname' and\n dteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000 \n", "hide": 0, @@ -1724,7 +1710,10 @@ "name": "dbmStatsDB", "query": "bk_dbm_stats", "skipUrlSync": false, - "type": "constant" + "type": "constant", + "current": {}, + "refresh": 1, + "options": [] } ] }, @@ -1735,7 +1724,36 @@ "timepicker": {}, "timezone": "default", "title": "TenDBCluster Table Detail", - "uid": "dehl3dd927oxsc", - "version": 15, - "weekStart": "" + "version": 17, + "weekStart": "", + "__inputs": [ + { + "name": "DS_蓝鲸监控_-_指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "蓝鲸监控 - 指标数据" + }, + { + "name": "DS_DBM-STATSDB", + "label": "DBM-StatsDB", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "DBM-StatsDB" + } + ], + "__requires": [ + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "蓝鲸监控 - 指标数据" + }, + { + "type": "datasource", + "id": "mysql", + "name": "DBM-StatsDB" + } + ] } \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json index 5b1d49ce4a..8c4917be36 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbcluster.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 29949, "links": [], "liveNow": false, "panels": [ @@ -44,7 +43,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -116,7 +115,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -142,7 +141,7 @@ "method": "AVG", "metric_field": "mysql_version_info", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -182,7 +181,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -238,7 +237,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -261,7 +260,7 @@ "method": "MAX", "metric_field": "mysql_datadir_df_usage", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -296,7 +295,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -347,7 +346,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -374,7 +373,7 @@ "method": "SUM", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -405,7 +404,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -432,7 +431,7 @@ "method": "SUM", "metric_field": "mysql_datadir_df_total_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -467,7 +466,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -549,7 +548,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -606,7 +605,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -691,7 +690,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -727,7 +726,7 @@ "method": "AVG", "metric_field": "mysql_global_status_commands_total", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -793,7 +792,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -876,7 +875,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -919,7 +918,7 @@ "method": "SUM", "metric_field": "mysql_global_status_slow_queries", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -945,7 +944,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1029,7 +1028,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1056,7 +1055,7 @@ "method": "SUM", "metric_field": "mysql_info_schema_processlist_threads", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.plist", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -1090,7 +1089,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1173,7 +1172,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -1328,7 +1327,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1397,7 +1396,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1482,7 +1481,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -1523,7 +1522,7 @@ "method": "AVG", "metric_field": "mysql_global_status_table_open_cache_hits", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1568,7 +1567,7 @@ "method": "AVG", "metric_field": "mysql_global_status_table_open_cache_hits", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1613,7 +1612,7 @@ "method": "AVG", "metric_field": "mysql_global_status_table_open_cache_misses", "refId": "c", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1647,7 +1646,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -1732,7 +1731,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": false, "expressionList": [], @@ -1769,7 +1768,7 @@ "method": "AVG", "metric_field": "mysql_global_status_commands_total", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -1808,7 +1807,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1828,7 +1827,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1848,7 +1847,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1871,7 +1870,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1952,7 +1951,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1981,7 +1980,7 @@ "method": "AVG", "metric_field": "mysql_slave_status_seconds_behind_master", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2017,7 +2016,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "Click link to get details for this instance", "fieldConfig": { @@ -2136,7 +2135,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -2165,7 +2164,7 @@ "method": "MAX", "metric_field": "mysql_version_info", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2207,7 +2206,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -2290,7 +2289,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2314,7 +2313,7 @@ "method": "MAX", "metric_field": "mysql_global_status_threads_connected", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -2345,7 +2344,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2364,7 +2363,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2386,7 +2385,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -2470,7 +2469,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": false, "expressionList": [], @@ -2494,7 +2493,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -2578,7 +2577,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2604,7 +2603,7 @@ "method": "AVG", "metric_field": "mysql_global_status_connection_used_percent", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2638,7 +2637,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -2721,7 +2720,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2757,7 +2756,7 @@ "method": "AVG", "metric_field": "mysql_global_status_commands_total", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -2823,7 +2822,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -2906,7 +2905,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": false, "expressionList": [], @@ -2943,7 +2942,7 @@ "method": "AVG", "metric_field": "mysql_global_status_threads_created", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2977,7 +2976,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -3060,7 +3059,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3096,7 +3095,7 @@ "method": "AVG", "metric_field": "mysql_global_status_questions", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -3130,7 +3129,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -3209,7 +3208,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -3252,7 +3251,7 @@ "method": "SUM", "metric_field": "mysql_global_status_slow_queries", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -3286,7 +3285,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -3369,7 +3368,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3405,7 +3404,7 @@ "method": "AVG", "metric_field": "mysql_global_status_queries", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -3439,7 +3438,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3522,7 +3521,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3558,7 +3557,7 @@ "method": "SUM", "metric_field": "mysql_global_status_open_tables", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -3592,7 +3591,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3674,7 +3673,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3710,7 +3709,7 @@ "method": "SUM", "metric_field": "mysql_global_status_opened_files", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.gstatus", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -3744,7 +3743,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3828,7 +3827,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -3869,7 +3868,7 @@ "method": "AVG", "metric_field": "mysql_info_schema_query_response_time_seconds_sum", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -3914,7 +3913,7 @@ "method": "AVG", "metric_field": "mysql_info_schema_query_response_time_seconds_count", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -3948,7 +3947,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -4028,7 +4027,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4053,7 +4052,7 @@ "method": "AVG", "metric_field": "mysql_infodba_schema_heartbeat_delay_sec", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -4082,7 +4081,7 @@ "method": "AVG", "metric_field": "mysql_infodba_schema_heartbeat_beat_sec", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -4108,7 +4107,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -4188,7 +4187,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4215,7 +4214,7 @@ "method": "AVG", "metric_field": "mysql_slave_status_seconds_behind_master", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.slavestat", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "", "where": [ @@ -4241,7 +4240,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -4320,7 +4319,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -4347,7 +4346,7 @@ "method": "MAX", "metric_field": "mysql_engine_innodb_trx_idle_time_max", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -4381,7 +4380,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -4460,7 +4459,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -4487,7 +4486,7 @@ "method": "MAX", "metric_field": "mysql_engine_innodb_trx_long_time_max", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -4535,7 +4534,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4580,7 +4579,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4595,7 +4595,7 @@ "h": 5, "w": 12, "x": 0, - "y": 67 + "y": 28 }, "id": 94, "options": { @@ -4616,7 +4616,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4675,7 +4675,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4720,7 +4720,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4735,7 +4736,7 @@ "h": 5, "w": 12, "x": 12, - "y": 67 + "y": 28 }, "id": 115, "options": { @@ -4756,7 +4757,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4815,7 +4816,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -4860,7 +4861,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4875,7 +4877,7 @@ "h": 5, "w": 12, "x": 0, - "y": 72 + "y": 33 }, "id": 11, "options": { @@ -4896,7 +4898,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4956,7 +4958,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5001,7 +5003,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5017,7 +5020,7 @@ "h": 5, "w": 12, "x": 12, - "y": 72 + "y": 33 }, "id": 77, "options": { @@ -5038,7 +5041,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5172,7 +5175,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -5216,7 +5219,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5232,7 +5236,7 @@ "h": 5, "w": 12, "x": 0, - "y": 77 + "y": 38 }, "id": 93, "interval": "1h", @@ -5253,7 +5257,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5280,7 +5284,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_usage", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.datasize", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -5314,7 +5318,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5359,7 +5363,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5375,7 +5380,7 @@ "h": 5, "w": 12, "x": 12, - "y": 77 + "y": 38 }, "id": 97, "options": { @@ -5396,7 +5401,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5491,7 +5496,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -5554,7 +5559,7 @@ "h": 5, "w": 12, "x": 0, - "y": 82 + "y": 43 }, "id": 104, "interval": "2h", @@ -5575,7 +5580,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5601,7 +5606,7 @@ "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -5635,7 +5640,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5696,7 +5701,7 @@ "h": 5, "w": 12, "x": 12, - "y": 82 + "y": 43 }, "id": 128, "options": { @@ -5717,7 +5722,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -5777,7 +5782,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5838,7 +5843,7 @@ "h": 5, "w": 12, "x": 0, - "y": 87 + "y": 48 }, "id": 53, "options": { @@ -5859,7 +5864,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5986,7 +5991,7 @@ { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -6041,10 +6046,10 @@ "pluginVersion": "10.4.10", "targets": [ { - "dataset": "", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -6085,7 +6090,7 @@ { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -6093,50 +6098,13 @@ "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": "bytes" }, "overrides": [] @@ -6147,96 +6115,6 @@ "x": 12, "y": 29 }, - "id": 131, - "interval": "24h", - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "10.4.10", - "targets": [ - { - "dataset": "", - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \n $__time(dteventtimehour),database_name as metric,sum(database_size_max) as value FROM\n(\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n) as t\nGROUP BY dteventtimehour,database_name\nORDER BY dteventtimehour asc", - "refId": "A", - "sql": { - "columns": [ - { - "name": "SUM", - "parameters": [ - { - "name": "database_size", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "name": "database_name", - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "mysql_db_table_size_5005578" - } - ], - "timeFrom": "7d", - "title": "Database Size (ibd)", - "type": "timeseries" - }, - { - "datasource": { - "type": "mysql", - "uid": "bkdbm_statsdb_source" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 37 - }, "id": 133, "interval": "24h", "options": { @@ -6264,10 +6142,10 @@ "pluginVersion": "10.4.10", "targets": [ { - "dataset": "", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -6305,7 +6183,7 @@ "dataset": "__internal_schema", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -6339,7 +6217,7 @@ { "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -6383,7 +6261,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -6397,8 +6276,8 @@ }, "gridPos": { "h": 8, - "w": 12, - "x": 12, + "w": 24, + "x": 0, "y": 37 }, "id": 132, @@ -6406,11 +6285,10 @@ "options": { "legend": { "calcs": [ - "lastNotNull", - "max" + "lastNotNull" ], "displayMode": "table", - "placement": "bottom", + "placement": "right", "showLegend": true, "sortBy": "Max", "sortDesc": true @@ -6423,10 +6301,10 @@ "pluginVersion": "10.4.10", "targets": [ { - "dataset": "", + "dataset": "bk_dbm_stats", "datasource": { "type": "mysql", - "uid": "bkdbm_statsdb_source" + "uid": "${DS_DBM-STATSDB}" }, "editorMode": "code", "format": "time_series", @@ -6481,7 +6359,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -6565,7 +6443,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -6592,7 +6470,7 @@ "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6627,7 +6505,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -6708,7 +6586,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -6735,7 +6613,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6773,7 +6651,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_total_mb", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6808,7 +6686,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -6891,7 +6769,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -6943,7 +6821,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -7008,7 +6886,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7035,7 +6913,7 @@ "method": "AVG", "metric_field": "mysql_up", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -7069,7 +6947,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -7152,7 +7030,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7189,7 +7067,7 @@ "method": "AVG", "metric_field": "mysql_global_status_questions", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -7215,7 +7093,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -7297,7 +7175,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7324,7 +7202,7 @@ "method": "AVG", "metric_field": "mysql_global_status_threads_connected", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -7350,7 +7228,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -7415,7 +7293,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7442,7 +7320,7 @@ "method": "AVG", "metric_field": "mysql_up", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -7476,7 +7354,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -7541,7 +7419,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7568,7 +7446,7 @@ "method": "AVG", "metric_field": "mysql_up", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -7612,14 +7490,10 @@ "templating": { "list": [ { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -7649,14 +7523,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -7702,43 +7572,13 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "spider_master", - "value": "spider_master" - }, + "current": {}, "hide": 0, "includeAll": false, "label": "dbrole", "multi": false, "name": "dbrole", - "options": [ - { - "selected": true, - "text": "spider_master", - "value": "spider_master" - }, - { - "selected": false, - "text": "spider_slave", - "value": "spider_slave" - }, - { - "selected": false, - "text": "remote_master", - "value": "remote_master" - }, - { - "selected": false, - "text": "remote_slave", - "value": "remote_slave" - }, - { - "selected": false, - "text": "spider_mnt", - "value": "spider_mnt" - } - ], + "options": [], "query": "spider_master,spider_slave,remote_master,remote_slave,spider_mnt", "queryValue": "", "refresh": 1, @@ -7746,15 +7586,10 @@ "type": "custom" }, { - "current": { - "isNone": true, - "selected": false, - "text": "None", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 2, @@ -7804,7 +7639,10 @@ "name": "dbmStatsDB", "query": "bk_dbm_stats", "skipUrlSync": false, - "type": "constant" + "type": "constant", + "current": {}, + "refresh": 1, + "options": [] } ] }, @@ -7815,7 +7653,36 @@ "timepicker": {}, "timezone": "default", "title": "TenDBCluster", - "uid": "8303483841", - "version": 39, - "weekStart": "" + "version": 42, + "weekStart": "", + "__inputs": [ + { + "name": "DS_蓝鲸监控_-_指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "蓝鲸监控 - 指标数据" + }, + { + "name": "DS_DBM-STATSDB", + "label": "DBM-StatsDB", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "DBM-StatsDB" + } + ], + "__requires": [ + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "蓝鲸监控 - 指标数据" + }, + { + "type": "datasource", + "id": "mysql", + "name": "DBM-StatsDB" + } + ] } \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha-table.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha-table.json new file mode 100644 index 0000000000..2a085d9c10 --- /dev/null +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha-table.json @@ -0,0 +1,1594 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 116, + "panels": [], + "title": "Table=$tbname", + "type": "row" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 112, + "interval": "1d", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric ,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n table_name in (${tbname:sqlstring}) AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Table Size", + "type": "timeseries" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 115, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 114, + "interval": "1d", + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour, database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=10\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT dteventtimehour, \"_OTHER._OTHER\" as metric, sum(value) as \"_OTHER._OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking >10\nGROUP BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "timeFrom": "2d", + "title": "Table Size Top20 for db=$dbname", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 113, + "interval": "1d", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM $dbmStatsDB.mysql_db_table_size\n WHERE cluster_domain = '$cluster_domain' AND \n database_name = '$dbname' AND\n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Table Size for db=$dbname", + "type": "timeseries" + } + ], + "title": "Database=$dbname", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 22, + "panels": [ + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decmbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 0, + "y": 9 + }, + "hideTimeOverride": true, + "id": 111, + "interval": "2h", + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.10", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "enableDownSampling": true, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "cluster_domain" + ], + "interval": 7200, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_datadir_du_used_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter", + "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" + ] + } + ] + } + ], + "refId": "A", + "source": "sum by (cluster_domain) (avg by (cluster_domain,instance)(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_du_used_mb{cluster_domain=\"$cluster_domain\",instance_role=\"backend_master\"}[121m])))", + "step": "", + "type": "range" + }, + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "enableDownSampling": true, + "expressionList": [], + "format": "time_series", + "hide": true, + "host": [], + "mode": "code", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "cluster_domain" + ], + "interval": 7200, + "interval_unit": "s", + "method": "SUM", + "metric_field": "mysql_datadir_df_total_mb", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter", + "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" + ] + } + ] + } + ], + "refId": "B", + "source": "sum by (cluster_domain) (avg by (cluster_domain,ip)(avg_over_time(bkmonitor:exporter_dbm_mysqld_exporter:mysql_datadir_df_total_mb{cluster_domain=\"$cluster_domain\",instance_role=\"remote_master\"}[121m])))", + "step": "", + "type": "range" + } + ], + "timeFrom": "24h", + "title": "Datadir Used for du size", + "type": "gauge" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 3, + "y": 9 + }, + "hideTimeOverride": true, + "id": 14, + "interval": "2h", + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "limit": 1, + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.10", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "enableDownSampling": true, + "expressionList": [], + "format": "table", + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [], + "interval": "auto", + "interval_unit": "s", + "method": "MAX", + "metric_field": "mysql_datadir_df_usage", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "timeFrom": "24h", + "title": "Datadir Usage", + "type": "gauge" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 6, + "y": 9 + }, + "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": "${DS_蓝鲸监控_-_指标数据}" + }, + "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", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + }, + { + "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", + "result_table_label": "component", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + }, + { + "condition": "and", + "key": "instance_role", + "method": "eq", + "value": [ + "backend_master" + ] + } + ] + } + ], + "refId": "A", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Datadir size for df partition", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "description": "磁盘空间使用率", + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 10, + "x": 14, + "y": 9 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.1.0", + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "enableDownSampling": true, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "", + "query_configs": [ + { + "alias": "$tag_instance_role,$tag_bk_target_ip: $tag_mount_point", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "mount_point", + "bk_target_ip", + "instance_role" + ], + "interval": "auto", + "interval_unit": "s", + "method": "AVG", + "metric_field": "used", + "refId": "a", + "result_table_id": "dbm_system.disk", + "result_table_label": "os", + "time_field": "time", + "where": [ + { + "key": "cluster_domain", + "method": "eq", + "value": [ + "$cluster_domain" + ] + } + ] + } + ], + "refId": "C", + "source": "", + "step": "", + "type": "range" + } + ], + "title": "Host Disk Used", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 14, + "x": 0, + "y": 14 + }, + "id": 119, + "interval": "1d", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=20\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),\"_OTHER._OTHER\" as metric, sum(value) as \"_OTHER._OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking >20\nGROUP BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Table Size Top20 (ibd)", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 14, + "y": 14 + }, + "id": 117, + "interval": "1d", + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), database_name as metric, value\nFROM\n(\n SELECT\n dteventtimehour,database_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name,sum(database_size_max) as value FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name\n ) tt\n) ttt\nWHERE ranking <=20\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), \"_OTHER\" as metric, sum(value) as \"_OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name,sum(database_size_max) as value FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name\n ) tt\n) ttt\nWHERE ranking >20\nGROUP BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Database Size Top20 (ibd)", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "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", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 19, + "y": 14 + }, + "id": 118, + "interval": "1d", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),database_name as metric,sum(database_size_max) as value FROM\n(\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n) as t\nGROUP BY dteventtimehour,database_name\nORDER BY dteventtimehour asc", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Database Size (ibd)", + "type": "timeseries" + } + ], + "title": "Cluster", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 39, + "tags": [ + "tendbha", + "表容量视图" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "definition": "- Blueking Monitor - 维度", + "hide": 0, + "includeAll": false, + "label": "app", + "multi": false, + "name": "app", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "app", + "metric_field": "mysql_up", + "result_table_id": "exporter_dbm_mysqld_exporter.group_default", + "result_table_label": "component", + "where": [] + }, + "queryType": "dimension", + "variables": "" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "definition": "- Blueking Monitor - 维度", + "hide": 0, + "includeAll": false, + "label": "cluster_domain", + "multi": false, + "name": "cluster_domain", + "options": [], + "query": { + "metricConfig": { + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "group_by": "cluster_domain", + "metric_field": "mysql_up", + "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_label": "component", + "where": [ + { + "key": "app", + "method": "eq", + "value": [ + "$app" + ] + }, + { + "condition": "and", + "key": "cluster_type", + "method": "eq", + "value": [ + "tendbha", + "tendbsingle" + ] + } + ] + }, + "queryType": "dimension", + "variables": "$app" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "definition": "select distinct database_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \ndteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000", + "hide": 0, + "includeAll": false, + "label": "dbname", + "multi": false, + "name": "dbname", + "options": [], + "query": "select distinct database_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \ndteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "definition": "select distinct table_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \n database_name = '$dbname' and\n dteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000 \n", + "hide": 0, + "includeAll": false, + "label": "tbname", + "multi": false, + "name": "tbname", + "options": [], + "query": "select distinct table_name \nfrom ${dbmStatsDB}.mysql_db_table_size \nwhere cluster_domain = '$cluster_domain' and \n database_name = '$dbname' and\n dteventtimestamp > (UNIX_TIMESTAMP(now())-86400*2)*1000 \n", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "hide": 2, + "name": "dbmStatsDB", + "query": "bk_dbm_stats", + "skipUrlSync": false, + "type": "constant", + "current": {}, + "refresh": 1, + "options": [] + } + ] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": {}, + "timezone": "default", + "title": "MySQL Table Detail", + "version": 6, + "weekStart": "", + "__inputs": [ + { + "name": "DS_蓝鲸监控_-_指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "蓝鲸监控 - 指标数据" + }, + { + "name": "DS_DBM-STATSDB", + "label": "DBM-StatsDB", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "DBM-StatsDB" + } + ], + "__requires": [ + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "蓝鲸监控 - 指标数据" + }, + { + "type": "datasource", + "id": "mysql", + "name": "DBM-StatsDB" + } + ] +} \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json index 8456cc9599..6103f6bec8 100644 --- a/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json +++ b/dbm-ui/backend/bk_dataview/dashboards/json/tendbha.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 29813, "links": [], "liveNow": false, "panels": [ @@ -44,7 +43,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "The partition disk usage for datadir.", "fieldConfig": { @@ -100,7 +99,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -124,7 +123,7 @@ "method": "MAX", "metric_field": "mysql_datadir_df_usage", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -159,7 +158,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -241,7 +240,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -298,7 +297,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -380,7 +379,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -439,7 +438,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -520,7 +519,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -548,7 +547,7 @@ "method": "AVG", "metric_field": "mysql_slave_status_seconds_behind_master", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -574,7 +573,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -626,7 +625,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -651,7 +650,7 @@ "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -685,7 +684,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -745,7 +744,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -769,7 +768,7 @@ "method": "AVG", "metric_field": "mysql_global_status_connection_used_percent", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -803,7 +802,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -859,7 +858,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -883,7 +882,7 @@ "method": "AVG", "metric_field": "mysql_global_status_innodb_buffer_pool_hit_ratio", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -917,7 +916,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "select|insert|update|delete|replace|commit", "fieldConfig": { @@ -1001,7 +1000,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1102,7 +1101,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -1187,7 +1186,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1210,7 +1209,7 @@ "method": "MAX", "metric_field": "mysql_global_status_threads_connected", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1241,7 +1240,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1260,7 +1259,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1283,7 +1282,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -1335,7 +1334,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1391,7 +1390,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1449,7 +1448,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -1476,7 +1475,7 @@ "method": "AVG", "metric_field": "mysql_version_info", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1517,7 +1516,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1581,7 +1580,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -1606,7 +1605,7 @@ "method": "AVG", "metric_field": "mysql_up", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1635,7 +1634,7 @@ "method": "AVG", "metric_field": "mysqlproxy_up", "refId": "b", - "result_table_id": "exporter_dbm_mysqlproxy_exporter.__default__", + "result_table_id": "exporter_dbm_mysqlproxy_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1661,7 +1660,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -1744,7 +1743,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [ @@ -1786,7 +1785,7 @@ "method": "SUM", "metric_field": "mysql_global_status_slow_queries", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1820,7 +1819,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -1904,7 +1903,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -1941,7 +1940,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -1972,7 +1971,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -2009,7 +2008,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2040,7 +2039,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -2060,7 +2059,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -2097,7 +2096,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2141,7 +2140,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -2221,7 +2220,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -2249,7 +2248,7 @@ "method": "AVG", "metric_field": "mysql_slave_status_seconds_behind_master", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2275,7 +2274,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -2355,7 +2354,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -2383,7 +2382,7 @@ "method": "AVG", "metric_field": "mysql_infodba_schema_heartbeat_delay_sec", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2414,7 +2413,7 @@ "method": "AVG", "metric_field": "mysql_infodba_schema_heartbeat_beat_sec", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -2454,7 +2453,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -2534,7 +2533,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -2603,7 +2602,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -2683,7 +2682,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -2759,7 +2758,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -2839,7 +2838,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -2929,7 +2928,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -3011,7 +3010,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3078,7 +3077,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -3161,7 +3160,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3214,7 +3213,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3233,7 +3232,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3255,7 +3254,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -3313,7 +3312,7 @@ }, "gridPos": { "h": 8, - "w": 12, + "w": 6, "x": 0, "y": 30 }, @@ -3325,7 +3324,7 @@ "max" ], "displayMode": "table", - "placement": "right", + "placement": "bottom", "showLegend": true }, "tooltip": { @@ -3338,7 +3337,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3391,7 +3390,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3410,7 +3409,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3432,7 +3431,152 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "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": "", + "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": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 30 + }, + "id": 104, + "options": { + "legend": { + "calcs": [ + "last", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "cluster": [], + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" + }, + "enableDownSampling": false, + "expressionList": [], + "format": "time_series", + "hide": false, + "host": [], + "mode": "ui", + "module": [], + "promqlAlias": "Max Ever Used", + "query_configs": [ + { + "alias": "$tag_instance", + "data_label": "exporter_dbm_mysqld_exporter", + "data_source_label": "bk_monitor", + "data_type_label": "time_series", + "display": true, + "filter_dict": {}, + "functions": [], + "group_by": [ + "instance" + ], + "interval": 60, + "interval_unit": "s", + "method": "MAX", + "metric_field": "mysql_global_status_connection_used_percent", + "refId": "a", + "result_table_id": "exporter_dbm_mysqld_exporter", + "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" + ] + } + ] + } + ], + "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" + } + ], + "title": "Connection Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "bkmonitor-timeseries-datasource", + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "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": { @@ -3515,7 +3659,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3568,7 +3712,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3587,7 +3731,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3623,7 +3767,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3707,7 +3851,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3733,7 +3877,7 @@ "method": "MAX", "metric_field": "mysqlproxy_process_total", "refId": "a", - "result_table_id": "exporter_dbm_mysqlproxy_exporter.__default__", + "result_table_id": "exporter_dbm_mysqlproxy_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -3759,7 +3903,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3840,7 +3984,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -3899,7 +4043,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -3981,7 +4125,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4099,7 +4243,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4181,7 +4325,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4278,7 +4422,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -4359,7 +4503,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4427,7 +4571,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘io使用率", "fieldConfig": { @@ -4508,7 +4652,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4581,7 +4725,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4662,7 +4806,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -4715,7 +4859,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4797,7 +4941,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -4892,7 +5036,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -4974,7 +5118,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5062,7 +5206,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5119,7 +5263,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -5200,7 +5344,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5267,7 +5411,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5349,7 +5493,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5444,7 +5588,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -5526,7 +5670,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5621,7 +5765,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -5702,7 +5846,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5758,7 +5902,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5817,7 +5961,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "磁盘空间使用率", "fieldConfig": { @@ -5898,7 +6042,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -5955,7 +6099,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -6037,7 +6181,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -6160,8 +6304,8 @@ "panels": [ { "datasource": { - "type": "bk_log_datasource", - "uid": "hHrSbzgIk" + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -6169,50 +6313,13 @@ "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": "bytes" }, "overrides": [] @@ -6226,133 +6333,218 @@ "id": 100, "interval": "24h", "options": { + "displayLabels": [], "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { "calcs": [ "lastNotNull" ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Last *", - "sortDesc": true + "fields": "", + "values": false }, "tooltip": { - "mode": "multi", - "sort": "desc" + "mode": "single", + "sort": "none" } }, "targets": [ { - "data": { - "alias": "$tag_database_name", - "conditions": [ - [ - { - "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" + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), database_name as metric, value\nFROM\n(\n SELECT\n dteventtimehour,database_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name,sum(database_size_max) as value FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name\n ) tt\n) ttt\nWHERE ranking <=20\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" }, - { - "key": "jaz8ohp0lx", - "list": [], - "type": "value", - "value": [ - "$cluster_domain" - ] - } - ] + "type": "groupBy" + } ], - "dimensions": [ - "database_name" + "limit": 50 + } + }, + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour), \"_OTHER\" as metric, sum(value) as \"_OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name,sum(database_size_max) as value FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n MAX(database_size) database_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name\n ) tt\n) ttt\nWHERE ranking >20\nGROUP BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } ], - "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": [] + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "timeFrom": "2d", + "title": "Database Size Top20 (ibd)", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false } }, + "mappings": [], + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 25 + }, + "id": 101, + "interval": "24h", + "options": { + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "dataset": "bk_dbm_stats", + "datasource": { + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" + }, + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=20\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "bk_dbm_stats", "datasource": { - "type": "bk_log_datasource", - "uid": "hHrSbzgIk" + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, - "refId": "A" + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),\"_OTHER._OTHER\" as metric, sum(value) as \"_OTHER._OTHER\"\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking >20\nGROUP BY dteventtimehour\nORDER BY dteventtimehour", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "timeFrom": "7d", - "title": "Database Size (ibd)", - "type": "timeseries" + "timeFrom": "2d", + "title": "Table Size Top20 (ibd)", + "type": "piechart" }, { "datasource": { - "type": "bk_log_datasource", - "uid": "hHrSbzgIk" + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, "fieldConfig": { "defaults": { @@ -6396,7 +6588,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -6409,142 +6602,65 @@ "overrides": [] }, "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 25 + "h": 7, + "w": 24, + "x": 0, + "y": 34 }, - "id": 101, + "id": 105, "interval": "24h", "options": { "legend": { - "calcs": [ - "lastNotNull" - ], + "calcs": [], "displayMode": "table", "placement": "right", - "showLegend": true, - "sortBy": "Last *", - "sortDesc": true + "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "mode": "single", + "sort": "none" } }, "targets": [ { - "data": { - "alias": "$tag_database_name . $tag_table_name", - "conditions": [ - [ - { - "key": "vffqcs8tyr", - "list": [ - { - "id": "cluster_domain", - "name": "cluster_domain" - } - ], - "open": false, - "type": "key", - "value": "cluster_domain" - }, - { - "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": [] - } - }, + "dataset": "bk_dbm_stats", "datasource": { - "type": "bk_log_datasource", - "uid": "hHrSbzgIk" + "type": "mysql", + "uid": "${DS_DBM-STATSDB}" }, - "refId": "A" + "editorMode": "code", + "format": "time_series", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT $__time(dteventtimehour),concat(database_name,\".\", table_name) as metric,value\nFROM\n(\n SELECT\n dteventtimehour,database_name, table_name,value,\n dense_rank() over (partition by dteventtimehour order by value desc) as ranking\n FROM\n (\n SELECT \n dteventtimehour,database_name, table_name, sum(table_size_max) as value \n FROM\n (\n SELECT \n dteventtimehour, \n database_name,\n original_database_name,\n table_name,\n MAX(table_size) table_size_max \n FROM ${dbmStatsDB}.mysql_db_table_size \n WHERE cluster_domain = '$cluster_domain' AND \n $__timeFilter(dteventtimehour)\n GROUP BY database_name,original_database_name,table_name,dteventtimehour\n ) as t\n GROUP BY dteventtimehour,database_name,table_name\n ) as tt\n) ttt\nWHERE ranking <=20\nORDER BY dteventtimehour", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], "timeFrom": "7d", - "title": "Table Size Top 50 (ibd)", + "title": "Table Size Top20 (ibd)", "type": "timeseries" }, { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -6591,7 +6707,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -6607,7 +6724,7 @@ "h": 9, "w": 12, "x": 0, - "y": 34 + "y": 41 }, "id": 65, "interval": "2h", @@ -6630,7 +6747,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -6658,7 +6775,7 @@ "method": "AVG", "metric_field": "mysql_datadir_du_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6684,7 +6801,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -6728,7 +6845,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -6744,7 +6862,7 @@ "h": 9, "w": 12, "x": 12, - "y": 34 + "y": 41 }, "id": 84, "interval": "2h", @@ -6767,7 +6885,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -6795,7 +6913,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_used_mb", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6826,7 +6944,7 @@ "method": "AVG", "metric_field": "mysql_datadir_df_total_mb", "refId": "b", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -6866,7 +6984,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -6948,7 +7066,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -7110,7 +7228,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -7192,7 +7310,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -7368,7 +7486,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -7449,7 +7567,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7605,7 +7723,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "Shows how many selects were done without indexes. Such operations can impact performance.", "fieldConfig": { @@ -7686,7 +7804,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7798,7 +7916,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -7879,7 +7997,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -7947,7 +8065,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -8029,7 +8147,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8137,7 +8255,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8195,7 +8313,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -8277,7 +8395,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8385,7 +8503,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8443,7 +8561,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -8525,7 +8643,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8651,7 +8769,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -8735,7 +8853,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -8804,7 +8922,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -8887,7 +9005,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -8924,7 +9042,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -8955,7 +9073,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -8992,7 +9110,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -9023,7 +9141,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -9043,7 +9161,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "enableDownSampling": true, "expressionList": [], @@ -9080,7 +9198,7 @@ "method": "CP99", "metric_field": "mysql_info_schema_query_response_time_seconds_bucket", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -9128,7 +9246,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -9209,7 +9327,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [ { @@ -9301,7 +9419,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -9379,7 +9497,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -9403,7 +9521,7 @@ "method": "AVG", "metric_field": "mysql_engine_innodb_trx_idle_time_max", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -9437,7 +9555,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "description": "", "fieldConfig": { @@ -9535,7 +9653,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -9585,7 +9703,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "table", @@ -9653,7 +9771,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -9731,7 +9849,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -9755,7 +9873,7 @@ "method": "AVG", "metric_field": "mysql_engine_innodb_trx_count", "refId": "a", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", + "result_table_id": "exporter_dbm_mysqld_exporter", "result_table_label": "component", "time_field": "time", "where": [ @@ -9803,7 +9921,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -9885,7 +10003,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -9945,7 +10063,7 @@ { "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "fieldConfig": { "defaults": { @@ -10027,7 +10145,7 @@ "cluster": [], "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "bkmonitor_timeseries" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "expressionList": [], "format": "time_series", @@ -10096,14 +10214,10 @@ "templating": { "list": [ { - "current": { - "selected": false, - "text": "dba", - "value": "dba" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -10132,14 +10246,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "jam-testdb.test.dba.db", - "value": "jam-testdb.test.dba.db" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "hide": 0, @@ -10184,33 +10294,13 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "backend_master", - "value": "backend_master" - }, + "current": {}, "hide": 0, "includeAll": false, "label": "dbrole", "multi": false, "name": "dbrole", - "options": [ - { - "selected": true, - "text": "backend_master", - "value": "backend_master" - }, - { - "selected": false, - "text": "backend_slave", - "value": "backend_slave" - }, - { - "selected": false, - "text": "backend_repeater", - "value": "backend_repeater" - } - ], + "options": [], "query": "backend_master,backend_slave,backend_repeater", "queryValue": "", "refresh": 1, @@ -10218,14 +10308,10 @@ "type": "custom" }, { - "current": { - "selected": false, - "text": "", - "value": "" - }, + "current": {}, "datasource": { "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" + "uid": "${DS_蓝鲸监控_-_指标数据}" }, "definition": "- Blueking Monitor - 维度", "description": "host", @@ -10271,57 +10357,14 @@ "type": "query" }, { - "current": { - "isNone": true, - "selected": false, - "text": "None", - "value": "" - }, - "datasource": { - "type": "bkmonitor-timeseries-datasource", - "uid": "${DS_蓝鲸监控_- 指标数据}" - }, - "definition": "- Blueking Monitor - 维度", "hide": 2, - "includeAll": false, - "label": "db_name", - "multi": false, - "name": "db_name", - "options": [], - "query": { - "metricConfig": { - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "group_by": "schema", - "metric_field": "mysql_info_schema_total_size", - "result_table_id": "exporter_dbm_mysqld_exporter.__default__", - "result_table_label": "component", - "where": [ - { - "key": "cluster_domain", - "method": "eq", - "value": [ - "$cluster_domain" - ] - }, - { - "condition": "and", - "key": "instance_role", - "method": "eq", - "value": [ - "backend_master" - ] - } - ] - }, - "queryType": "dimension", - "variables": "$cluster_domain" - }, - "refresh": 1, - "regex": "", + "name": "dbmStatsDB", + "query": "bk_dbm_stats", "skipUrlSync": false, - "sort": 0, - "type": "query" + "type": "constant", + "current": {}, + "refresh": 1, + "options": [] } ] }, @@ -10332,7 +10375,36 @@ "timepicker": {}, "timezone": "default", "title": "MySQL-HA", - "uid": "8wWk5T64z", - "version": 33, - "weekStart": "" + "version": 40, + "weekStart": "", + "__inputs": [ + { + "name": "DS_蓝鲸监控_-_指标数据", + "label": "蓝鲸监控 - 指标数据", + "description": "", + "type": "datasource", + "pluginId": "bkmonitor-timeseries-datasource", + "pluginName": "蓝鲸监控 - 指标数据" + }, + { + "name": "DS_DBM-STATSDB", + "label": "DBM-StatsDB", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "DBM-StatsDB" + } + ], + "__requires": [ + { + "type": "datasource", + "id": "bkmonitor-timeseries-datasource", + "name": "蓝鲸监控 - 指标数据" + }, + { + "type": "datasource", + "id": "mysql", + "name": "DBM-StatsDB" + } + ] } \ No newline at end of file diff --git a/dbm-ui/backend/bk_dataview/grafana/provisioning.py b/dbm-ui/backend/bk_dataview/grafana/provisioning.py index f033ca16f7..ef28815744 100644 --- a/dbm-ui/backend/bk_dataview/grafana/provisioning.py +++ b/dbm-ui/backend/bk_dataview/grafana/provisioning.py @@ -106,6 +106,8 @@ def replace_file_content(file_content: str, bkm_dbm_report: dict) -> str: # 刷新监控数据源ID:bkmonitor_timeseries file_content = file_content.replace("${DS_蓝鲸监控_- 指标数据}", "bkmonitor_timeseries") file_content = file_content.replace("${DS_日志平台}", "bklog") + file_content = file_content.replace("${DS_蓝鲸监控_-_指标数据}", "bkmonitor_timeseries") + file_content = file_content.replace("${DS_DBM-STATSDB}", "bkdbm_statsdb_source") file_content = file_content.replace('"editable": true', '"editable": false') # 批量替换基础指标来源:system -> dbm_system diff --git a/helm-charts/bk-dbm/Chart.lock b/helm-charts/bk-dbm/Chart.lock index 741746d283..d5f5a67141 100644 --- a/helm-charts/bk-dbm/Chart.lock +++ b/helm-charts/bk-dbm/Chart.lock @@ -55,7 +55,7 @@ dependencies: version: 0.0.3 - name: bkdata-kafka-consumer repository: file://charts/bkdata-kafka-consumer - version: 0.0.6 + version: 0.0.7 - name: db-remote-service repository: file://charts/db-remote-service version: 0.9.5 @@ -68,5 +68,5 @@ dependencies: - name: db-dbha repository: file://charts/db-dbha version: 0.1.0 -digest: sha256:a3fbdb586270673e1881cf1df21955bddd05e976d8650a6d43ae30949fd6e481 -generated: "2025-04-21T14:50:29.792631327+08:00" +digest: sha256:dc3ec328aa5118e1b1b992958c34c7f923e4fc9aea07a53889708fc1d47b04f8 +generated: "2025-04-22T18:46:15.038308679+08:00" diff --git a/helm-charts/bk-dbm/Chart.yaml b/helm-charts/bk-dbm/Chart.yaml index cdb3514510..500fd0f304 100644 --- a/helm-charts/bk-dbm/Chart.yaml +++ b/helm-charts/bk-dbm/Chart.yaml @@ -75,7 +75,7 @@ dependencies: - condition: bkdata-kafka-consumer.enabled name: bkdata-kafka-consumer repository: file://charts/bkdata-kafka-consumer - version: 0.0.6 + version: 0.0.7 - condition: global.cloudContainer name: db-remote-service repository: file://charts/db-remote-service @@ -95,5 +95,5 @@ dependencies: description: A Helm chart for bk-dbm name: bk-dbm type: application -version: 1.5.0-alpha.49 -appVersion: 1.5.0-alpha.49 +version: 1.5.0-alpha.50 +appVersion: 1.5.0-alpha.50 diff --git a/helm-charts/bk-dbm/charts/bkdata-kafka-consumer/Chart.yaml b/helm-charts/bk-dbm/charts/bkdata-kafka-consumer/Chart.yaml index 705c85c041..576ce20b4d 100644 --- a/helm-charts/bk-dbm/charts/bkdata-kafka-consumer/Chart.yaml +++ b/helm-charts/bk-dbm/charts/bkdata-kafka-consumer/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -appVersion: 0.0.1-alpha.13 +appVersion: 0.0.1-alpha.14 description: A Helm chart for bkdata-kafka-consumer name: bkdata-kafka-consumer type: application -version: 0.0.6 +version: 0.0.7 diff --git a/helm-charts/bk-dbm/templates/configmaps/bkdata-kafka-consumer-configmap.yaml b/helm-charts/bk-dbm/templates/configmaps/bkdata-kafka-consumer-configmap.yaml index 55847eeb5b..3d287e07d8 100644 --- a/helm-charts/bk-dbm/templates/configmaps/bkdata-kafka-consumer-configmap.yaml +++ b/helm-charts/bk-dbm/templates/configmaps/bkdata-kafka-consumer-configmap.yaml @@ -27,6 +27,7 @@ data: log_file_dir: logs data.mysql-db-table-size.yaml: |- - bk_data_id: {{ index .Values "bkdata-kafka-consumer" "mysql-db-table-size" "bk_data_id" }} + client_id: {{ index .Values "bkdata-kafka-consumer" "mysql-db-table-size" "group_id" }} group_id: {{ index .Values "bkdata-kafka-consumer" "mysql-db-table-size" "group_id" }} from_beginning: false sink_batch_size: 10 @@ -42,6 +43,7 @@ data: data.mysql-backup-result.yaml: |- - bk_data_id: {{ index .Values "bkdata-kafka-consumer" "mysql-backup-result" "bk_data_id" }} + client_id: {{ index .Values "bkdata-kafka-consumer" "mysql-backup-result" "group_id" }} group_id: {{ index .Values "bkdata-kafka-consumer" "mysql-backup-result" "group_id" }} from_beginning: false sink_batch_size: 1 @@ -57,6 +59,7 @@ data: data.mysql-binlog-result.yaml: |- - bk_data_id: {{ index .Values "bkdata-kafka-consumer" "mysql-binlog-result" "bk_data_id" }} + client_id: {{ index .Values "bkdata-kafka-consumer" "mysql-binlog-result" "group_id" }} group_id: {{ index .Values "bkdata-kafka-consumer" "mysql-binlog-result" "group_id" }} from_beginning: false sink_batch_size: 1