From c34d726fd6d3c563eabcbcdcec386a96e665da82 Mon Sep 17 00:00:00 2001 From: you06 Date: Fri, 28 Apr 2023 10:27:52 +0800 Subject: [PATCH] This is an automated cherry-pick of #43324 Signed-off-by: ti-chi-bot --- DEPS.bzl | 5 + go.mod | 5 + go.sum | 7 ++ metrics/grafana/tidb.json | 200 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 217 insertions(+) diff --git a/DEPS.bzl b/DEPS.bzl index 4fcc366298a20..d26539b718c09 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -4164,8 +4164,13 @@ def go_deps(): name = "com_github_tikv_client_go_v2", build_file_proto_mode = "disable_global", importpath = "github.com/tikv/client-go/v2", +<<<<<<< HEAD sum = "h1:uMwa1WlF51WU3capFUiTHjn7U71wiPHyRmdkde7GWlA=", version = "v2.0.8-0.20230524032653-1b2876693630", +======= + sum = "h1:DQjgnd+43C2CWyUh4juc6ewsYLOqrSJuuqgM3kAo47E=", + version = "v2.0.8-0.20230427065546-c619a504747d", +>>>>>>> e9184f7640d (grafana: add traffic metrics for staleread traffic (#43324)) ) go_repository( name = "com_github_tikv_pd", diff --git a/go.mod b/go.mod index 13f4c904b29a5..eff8f2ee2fadc 100644 --- a/go.mod +++ b/go.mod @@ -94,8 +94,13 @@ require ( github.com/stretchr/testify v1.8.2 github.com/tdakkota/asciicheck v0.2.0 github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 +<<<<<<< HEAD github.com/tikv/client-go/v2 v2.0.8-0.20230524032653-1b2876693630 github.com/tikv/pd/client v0.0.0-20230519121736-d15a686a670e +======= + github.com/tikv/client-go/v2 v2.0.8-0.20230427065546-c619a504747d + github.com/tikv/pd/client v0.0.0-20230419153320-f1d1a80feb95 +>>>>>>> e9184f7640d (grafana: add traffic metrics for staleread traffic (#43324)) github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e github.com/twmb/murmur3 v1.1.6 github.com/uber/jaeger-client-go v2.22.1+incompatible diff --git a/go.sum b/go.sum index e04342dfb153b..8b93a87d67def 100644 --- a/go.sum +++ b/go.sum @@ -960,10 +960,17 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJf github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= +<<<<<<< HEAD github.com/tikv/client-go/v2 v2.0.8-0.20230524032653-1b2876693630 h1:uMwa1WlF51WU3capFUiTHjn7U71wiPHyRmdkde7GWlA= github.com/tikv/client-go/v2 v2.0.8-0.20230524032653-1b2876693630/go.mod h1:XgUt8nFfG23jaEPlF+rRVUwSjSE/Aozi0LYRWzt1ar8= github.com/tikv/pd/client v0.0.0-20230519121736-d15a686a670e h1:dO0YtekJ9IKiO9dXMZz0rNHPBiGCo+c37RUsnshoLwo= github.com/tikv/pd/client v0.0.0-20230519121736-d15a686a670e/go.mod h1:5vgcvO020ZCdMZkTrRdS/wFZQUab82BSfKE38T61ro0= +======= +github.com/tikv/client-go/v2 v2.0.8-0.20230427065546-c619a504747d h1:DQjgnd+43C2CWyUh4juc6ewsYLOqrSJuuqgM3kAo47E= +github.com/tikv/client-go/v2 v2.0.8-0.20230427065546-c619a504747d/go.mod h1:JhXnkzPnxpgXj9Tww4P6sayf9TtsnB9XrtS71jfzq+U= +github.com/tikv/pd/client v0.0.0-20230419153320-f1d1a80feb95 h1:177X/S43/qjxDyFq9CBB4Nts0nwLvjJFXzoav2XCUSA= +github.com/tikv/pd/client v0.0.0-20230419153320-f1d1a80feb95/go.mod h1:5vgcvO020ZCdMZkTrRdS/wFZQUab82BSfKE38T61ro0= +>>>>>>> e9184f7640d (grafana: add traffic metrics for staleread traffic (#43324)) github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo= github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= diff --git a/metrics/grafana/tidb.json b/metrics/grafana/tidb.json index 8085ed0c1bd04..af1e679efb6a1 100644 --- a/metrics/grafana/tidb.json +++ b/metrics/grafana/tidb.json @@ -10200,6 +10200,206 @@ "align": false, "alignLevel": null } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_TEST-CLUSTER}", + "description": "TiDB hit/miss stale-read operations count", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 50 + }, + "hiddenSeries": false, + "id": 306, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.11", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "exemplar": true, + "expr": "sum(rate(tidb_tikvclient_stale_read_bytes_count{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", direction=\"in\"}[1m])) by (result)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{result}}", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Stale Read OPS", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_TEST-CLUSTER}", + "description": "TiDB hit/miss stale-read traffic statistic", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 50 + }, + "hiddenSeries": false, + "id": 307, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.11", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "exemplar": true, + "expr": "sum(rate(tidb_tikvclient_stale_read_bytes_sum{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (result, direction)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{result}}-{{direction}}", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Stale Read Traffic", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:156", + "format": "Bps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:157", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], "repeat": null,