Skip to content

Commit

Permalink
*: update tikv/client-go and fix stale read metrics in grafana (#45530)
Browse files Browse the repository at this point in the history
close #45339
  • Loading branch information
crazycs520 authored Jul 25, 2023
1 parent cf5b115 commit b852d16
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 24 deletions.
4 changes: 2 additions & 2 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3696,8 +3696,8 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:jwRmcYsM0QeJcIRhnWfLhfNfwpiEAeQXioefEN6aBeI=",
version = "v2.0.4-0.20230628093657-7d0806ee6883",
sum = "h1:epuGF+KffiPTxWuuStzv63nIRV4PDedDwhIOLyTxrRQ=",
version = "v2.0.4-0.20230714024544-c7e214f2c32b",
)
go_repository(
name = "com_github_tikv_pd_client",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ require (
github.com/stretchr/testify v1.8.0
github.com/tdakkota/asciicheck v0.1.1
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.4-0.20230628093657-7d0806ee6883
github.com/tikv/client-go/v2 v2.0.4-0.20230714024544-c7e214f2c32b
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144
github.com/twmb/murmur3 v1.1.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,8 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ=
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
github.com/tikv/client-go/v2 v2.0.4-0.20230628093657-7d0806ee6883 h1:jwRmcYsM0QeJcIRhnWfLhfNfwpiEAeQXioefEN6aBeI=
github.com/tikv/client-go/v2 v2.0.4-0.20230628093657-7d0806ee6883/go.mod h1:mmVCLP2OqWvQJPOIevQPZvGphzh/oq9vv8J5LDfpadQ=
github.com/tikv/client-go/v2 v2.0.4-0.20230714024544-c7e214f2c32b h1:epuGF+KffiPTxWuuStzv63nIRV4PDedDwhIOLyTxrRQ=
github.com/tikv/client-go/v2 v2.0.4-0.20230714024544-c7e214f2c32b/go.mod h1:mmVCLP2OqWvQJPOIevQPZvGphzh/oq9vv8J5LDfpadQ=
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07 h1:ckPpxKcl75mO2N6a4cJXiZH43hvcHPpqc9dh1TmH1nc=
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07/go.mod h1:CipBxPfxPUME+BImx9MUYXCnAVLS3VJUr3mnSJwh40A=
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro=
Expand Down
147 changes: 128 additions & 19 deletions metrics/grafana/tidb.json
Original file line number Diff line number Diff line change
Expand Up @@ -10016,18 +10016,20 @@
"h": 7,
"w": 8,
"x": 0,
"y": 50
"y": 29
},
"hiddenSeries": false,
"id": 306,
"legend": {
"avg": false,
"current": false,
"max": false,
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
"values": true
},
"lines": true,
"linewidth": 1,
Expand All @@ -10048,7 +10050,7 @@
"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)",
"expr": "sum(rate(tidb_tikvclient_stale_read_counter{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (result)",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand All @@ -10061,7 +10063,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Stale Read OPS",
"title": "Stale Read Hit/Miss OPS",
"tooltip": {
"shared": true,
"sort": 0,
Expand Down Expand Up @@ -10104,7 +10106,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"description": "TiDB hit/miss stale-read traffic statistic",
"description": "TiDB stale-read requests count",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand All @@ -10115,18 +10117,20 @@
"h": 7,
"w": 8,
"x": 8,
"y": 50
"y": 29
},
"hiddenSeries": false,
"id": 307,
"legend": {
"avg": false,
"current": false,
"max": false,
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
"values": true
},
"lines": true,
"linewidth": 1,
Expand All @@ -10147,8 +10151,113 @@
"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)",
"expr": "sum(rate(tidb_tikvclient_stale_read_req_counter{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type)",
"format": "time_series",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{type}}",
"refId": "A",
"step": 30
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Stale Read Req OPS",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:240",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:241",
"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 stale-read requests traffic statistic",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 8,
"x": 16,
"y": 29
},
"hiddenSeries": false,
"id": 308,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"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{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (result, direction)",
"format": "time_series",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{result}}-{{direction}}",
Expand All @@ -10160,7 +10269,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Stale Read Traffic",
"title": "Stale Read Req Traffic",
"tooltip": {
"shared": true,
"sort": 0,
Expand All @@ -10176,7 +10285,7 @@
},
"yaxes": [
{
"$$hashKey": "object:156",
"$$hashKey": "object:327",
"format": "Bps",
"label": null,
"logBase": 1,
Expand All @@ -10185,13 +10294,13 @@
"show": true
},
{
"$$hashKey": "object:157",
"format": "short",
"$$hashKey": "object:328",
"format": "Bps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
"show": true
}
],
"yaxis": {
Expand Down

0 comments on commit b852d16

Please sign in to comment.