diff --git a/metrics/grafana/pd.json b/metrics/grafana/pd.json index 1cd8c3189af3..387c3ac4a55b 100644 --- a/metrics/grafana/pd.json +++ b/metrics/grafana/pd.json @@ -1663,7 +1663,7 @@ "tableColumn": "idalloc", "targets": [ { - "expr": "pd_cluster_id{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", type=\"idalloc\"}", + "expr": "max(pd_cluster_id{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", type=\"idalloc\"})", "format": "time_series", "hide": false, "instant": true, @@ -2202,7 +2202,7 @@ "tableColumn": "tso", "targets": [ { - "expr": "pd_cluster_tso{type=\"tso\", dc=\"global\"}", + "expr": "max(pd_cluster_tso{type=\"tso\", dc=\"global\"})", "format": "time_series", "instant": true, "interval": "", @@ -2508,7 +2508,7 @@ "tableColumn": "tso", "targets": [ { - "expr": "pd_cluster_tso{type=\"tso\", dc=\"global\"}", + "expr": "max(pd_cluster_tso{type=\"tso\", dc=\"global\"})", "format": "time_series", "instant": true, "interval": "", @@ -7814,7 +7814,7 @@ "tableColumn": "", "targets": [ { - "expr": "pd_checker_patrol_regions_time{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\"}", + "expr": "pd_checker_patrol_regions_time{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\"} != 0", "format": "time_series", "intervalFactor": 1, "refId": "A" @@ -9105,7 +9105,9 @@ "show": true, "sideWidth": 300, "total": false, - "values": true + "values": true, + "hideEmpty": true, + "hideZero": true }, "lines": true, "linewidth": 1, @@ -9200,7 +9202,9 @@ "show": true, "sideWidth": 300, "total": false, - "values": true + "values": true, + "hideEmpty": true, + "hideZero": true }, "lines": true, "linewidth": 1, @@ -9526,7 +9530,9 @@ "rightSide": true, "show": true, "total": false, - "values": true + "values": true, + "hideEmpty": true, + "hideZero": true }, "lines": true, "linewidth": 1, @@ -9723,7 +9729,9 @@ "rightSide": true, "show": true, "total": false, - "values": true + "values": true, + "hideEmpty": true, + "hideZero": true }, "lines": true, "linewidth": 1, diff --git a/pkg/schedule/coordinator.go b/pkg/schedule/coordinator.go index 8cd5567b75c5..946ea89e7f14 100644 --- a/pkg/schedule/coordinator.go +++ b/pkg/schedule/coordinator.go @@ -156,6 +156,7 @@ func (c *Coordinator) PatrolRegions() { // Note: we reset the ticker here to support updating configuration dynamically. ticker.Reset(c.cluster.GetCheckerConfig().GetPatrolRegionInterval()) case <-c.ctx.Done(): + patrolCheckRegionsGauge.Set(0) log.Info("patrol regions has been stopped") return }