From bf8aa5801cae7f435db979ee0c1be94a7e900e61 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Mon, 9 Nov 2020 15:31:05 +0800 Subject: [PATCH] metrics: add patrol time monitor (#3167) * add patrol time monitor Signed-off-by: Ryan Leung * address the comment Signed-off-by: Ryan Leung --- metrics/grafana/pd.json | 171 +++++++++++++++++++++++++++++----------- 1 file changed, 127 insertions(+), 44 deletions(-) diff --git a/metrics/grafana/pd.json b/metrics/grafana/pd.json index 24fe47aa3da..949ea18b36b 100644 --- a/metrics/grafana/pd.json +++ b/metrics/grafana/pd.json @@ -64,7 +64,7 @@ "gnetId": null, "graphTooltip": 1, "id": 21, - "iteration": 1598342251538, + "iteration": 1604903857894, "links": [], "panels": [ { @@ -4971,7 +4971,7 @@ "h": 8, "w": 24, "x": 0, - "y": 47 + "y": 19 }, "id": 46, "legend": { @@ -5065,7 +5065,7 @@ "h": 8, "w": 12, "x": 0, - "y": 55 + "y": 27 }, "id": 87, "legend": { @@ -5166,7 +5166,7 @@ "h": 8, "w": 12, "x": 12, - "y": 55 + "y": 27 }, "hideTimeOverride": false, "id": 86, @@ -5267,7 +5267,7 @@ "h": 8, "w": 12, "x": 0, - "y": 63 + "y": 35 }, "id": 89, "legend": { @@ -5358,7 +5358,7 @@ "h": 8, "w": 12, "x": 12, - "y": 63 + "y": 35 }, "id": 88, "legend": { @@ -5450,7 +5450,7 @@ "h": 8, "w": 12, "x": 0, - "y": 71 + "y": 43 }, "id": 52, "legend": { @@ -5545,7 +5545,7 @@ "h": 8, "w": 12, "x": 12, - "y": 71 + "y": 43 }, "id": 53, "legend": { @@ -5639,7 +5639,7 @@ "h": 8, "w": 24, "x": 0, - "y": 79 + "y": 51 }, "id": 108, "legend": { @@ -5722,6 +5722,89 @@ "alignLevel": null } }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_TEST-CLUSTER}", + "format": "s", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 59 + }, + "id": 1424, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "pluginVersion": "6.1.6", + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pd_checker_patrol_regions_time{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Patrol Region time", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, { "aliasColors": {}, "bars": false, @@ -5733,10 +5816,10 @@ "gridPos": { "h": 8, "w": 12, - "x": 0, - "y": 87 + "x": 12, + "y": 59 }, - "id": 70, + "id": 141, "legend": { "alignAsTable": true, "avg": false, @@ -5765,7 +5848,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"replica_checker\"}[1m])) by (name)", + "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"rule_checker\"}[1m])) by (name)", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{name}}", @@ -5777,7 +5860,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Replica checker", + "title": "Rule checker", "tooltip": { "shared": true, "sort": 0, @@ -5825,10 +5908,10 @@ "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 87 + "x": 0, + "y": 67 }, - "id": 141, + "id": 70, "legend": { "alignAsTable": true, "avg": false, @@ -5857,7 +5940,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"rule_checker\"}[1m])) by (name)", + "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"replica_checker\"}[1m])) by (name)", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{name}}", @@ -5869,7 +5952,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Rule checker", + "title": "Replica checker", "tooltip": { "shared": true, "sort": 0, @@ -5912,14 +5995,15 @@ "dashLength": 10, "dashes": false, "datasource": "${DS_TEST-CLUSTER}", + "description": "The merge checker's status", "fill": 0, "gridPos": { "h": 8, "w": 12, - "x": 0, - "y": 95 + "x": 12, + "y": 67 }, - "id": 110, + "id": 71, "legend": { "alignAsTable": true, "avg": false, @@ -5930,8 +6014,6 @@ "min": false, "rightSide": true, "show": true, - "sort": "current", - "sortDesc": true, "total": false, "values": true }, @@ -5950,20 +6032,19 @@ "steppedLine": false, "targets": [ { - "expr": "sum(delta(pd_schedule_filter{store=~\"$store\", action=\"filter-target\"}[1m])) by (store, type, scope)", + "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"merge_checker\"}[1m])) by (name)", "format": "time_series", "intervalFactor": 2, - "legendFormat": "{{scope}}-store-{{store}}-{{type}}", - "metric": "pd_scheduler_event_count", + "legendFormat": "{{name}}", "refId": "A", - "step": 4 + "step": 10 } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Filter target", + "title": "Region merge checker", "tooltip": { "shared": true, "sort": 0, @@ -5979,7 +6060,7 @@ }, "yaxes": [ { - "format": "ops", + "format": "short", "label": null, "logBase": 1, "max": null, @@ -6006,15 +6087,14 @@ "dashLength": 10, "dashes": false, "datasource": "${DS_TEST-CLUSTER}", - "description": "The merge checker's status", "fill": 0, "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 95 + "x": 0, + "y": 75 }, - "id": 71, + "id": 109, "legend": { "alignAsTable": true, "avg": false, @@ -6025,6 +6105,8 @@ "min": false, "rightSide": true, "show": true, + "sort": "current", + "sortDesc": true, "total": false, "values": true }, @@ -6043,19 +6125,20 @@ "steppedLine": false, "targets": [ { - "expr": "sum(delta(pd_checker_event_count{instance=\"$instance\", type=\"merge_checker\"}[1m])) by (name)", + "expr": "sum(delta(pd_schedule_filter{store=~\"$store\", action=\"filter-source\"}[1m])) by (store, type, scope)", "format": "time_series", "intervalFactor": 2, - "legendFormat": "{{name}}", + "legendFormat": "{{scope}}-store-{{store}}-{{type}}", + "metric": "pd_scheduler_event_count", "refId": "A", - "step": 10 + "step": 4 } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Region merge checker", + "title": "Filter source", "tooltip": { "shared": true, "sort": 0, @@ -6071,7 +6154,7 @@ }, "yaxes": [ { - "format": "short", + "format": "ops", "label": null, "logBase": 1, "max": null, @@ -6102,10 +6185,10 @@ "gridPos": { "h": 8, "w": 12, - "x": 0, - "y": 103 + "x": 12, + "y": 75 }, - "id": 109, + "id": 110, "legend": { "alignAsTable": true, "avg": false, @@ -6136,7 +6219,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(delta(pd_schedule_filter{store=~\"$store\", action=\"filter-source\"}[1m])) by (store, type, scope)", + "expr": "sum(delta(pd_schedule_filter{store=~\"$store\", action=\"filter-target\"}[1m])) by (store, type, scope)", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{scope}}-store-{{store}}-{{type}}", @@ -6149,7 +6232,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Filter source", + "title": "Filter target", "tooltip": { "shared": true, "sort": 0,