diff --git a/server/etcdserver/txn/metrics.go b/server/etcdserver/txn/metrics.go index 1763f2a75c8..af88257045b 100644 --- a/server/etcdserver/txn/metrics.go +++ b/server/etcdserver/txn/metrics.go @@ -43,21 +43,21 @@ var ( Namespace: "etcd", Subsystem: "server", Name: "range_duration_seconds", - Help: "The latency distributions of v2 apply called by backend.", + Help: "The latency distributions of txn.Range", // lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2 // highest bucket start of 0.0001 sec * 2^19 == 52.4288 sec Buckets: prometheus.ExponentialBuckets(0.0001, 2, 20), }, - []string{"version", "op", "success"}) + []string{"op", "success"}) ) func ApplySecObserve(version, op string, success bool, latency time.Duration) { applySec.WithLabelValues(version, op, strconv.FormatBool(success)).Observe(float64(latency.Microseconds()) / 1000000.0) } -func RangeSecObserve(version, op string, success bool, latency time.Duration) { - rangeSec.WithLabelValues(version, op, strconv.FormatBool(success)).Observe(float64(latency.Microseconds()) / 1000000.0) +func RangeSecObserve(op string, success bool, latency time.Duration) { + rangeSec.WithLabelValues(op, strconv.FormatBool(success)).Observe(float64(latency.Microseconds()) / 1000000.0) } func init() { diff --git a/server/etcdserver/txn/txn.go b/server/etcdserver/txn/txn.go index fdda188523b..177c1756a97 100644 --- a/server/etcdserver/txn/txn.go +++ b/server/etcdserver/txn/txn.go @@ -144,11 +144,9 @@ func Range(ctx context.Context, lg *zap.Logger, kv mvcc.KV, r *pb.RangeRequest) ctx = context.WithValue(ctx, traceutil.TraceKey{}, trace) } op := "range" - stringer := &pb.InternalRaftStringer{Request: &pb.InternalRaftRequest{Range: r}} defer func(start time.Time) { success := err == nil - RangeSecObserve(v3Version, op, success, time.Since(start)) - WarnOfExpensiveRequest(lg, DefaultRangeWarningApplyDuration, start, stringer, nil, nil) + RangeSecObserve(op, success, time.Since(start)) }(time.Now()) txnRead := kv.Read(mvcc.ConcurrentReadTxMode, trace) defer txnRead.End()