diff --git a/client/metrics.go b/client/metrics.go index e0b29fb8bcc..f3c47d7e787 100644 --- a/client/metrics.go +++ b/client/metrics.go @@ -105,7 +105,7 @@ func initMetrics(constLabels prometheus.Labels) { Subsystem: "request", Name: "tso_batch_send_latency", ConstLabels: constLabels, - Buckets: prometheus.ExponentialBuckets(1, 2, 34), // 1ns ~ 8s + Buckets: prometheus.ExponentialBuckets(0.0005, 2, 13), Help: "tso batch send latency", }) diff --git a/client/tso_stream.go b/client/tso_stream.go index 14b72bc697b..dd5b9422aae 100644 --- a/client/tso_stream.go +++ b/client/tso_stream.go @@ -139,7 +139,7 @@ func (s *pdTSOStream) processRequests( } return } - tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime))) + tsoBatchSendLatency.Observe(time.Since(batchStartTime).Seconds()) resp, err := s.stream.Recv() if err != nil { if err == io.EOF { @@ -195,7 +195,7 @@ func (s *tsoTSOStream) processRequests( } return } - tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime))) + tsoBatchSendLatency.Observe(time.Since(batchStartTime).Seconds()) resp, err := s.stream.Recv() if err != nil { if err == io.EOF { diff --git a/server/metrics.go b/server/metrics.go index 0935008a420..fdcc5b4be22 100644 --- a/server/metrics.go +++ b/server/metrics.go @@ -45,7 +45,7 @@ var ( Subsystem: "scheduler", Name: "region_heartbeat_latency_seconds", Help: "Bucketed histogram of latency (s) of receiving heartbeat.", - Buckets: prometheus.ExponentialBuckets(1, 2, 12), + Buckets: prometheus.ExponentialBuckets(0.0005, 2, 13), }, []string{"address", "store"}) metadataGauge = prometheus.NewGaugeVec(