tikv/client: remove unused grpc metric in tikv-client (#10233)
This commit is contained in:
2
go.mod
2
go.mod
@ -30,7 +30,7 @@ require (
|
||||
github.com/gorilla/mux v1.6.2
|
||||
github.com/gorilla/websocket v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.5.1 // indirect
|
||||
github.com/jonboulle/clockwork v0.1.0 // indirect
|
||||
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5
|
||||
|
||||
@ -22,9 +22,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
||||
"github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
"github.com/pingcap/errors"
|
||||
"github.com/pingcap/kvproto/pkg/coprocessor"
|
||||
"github.com/pingcap/kvproto/pkg/debugpb"
|
||||
@ -207,18 +205,14 @@ func (a *connArray) Init(addr string, security config.Security) error {
|
||||
opt = grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig))
|
||||
}
|
||||
|
||||
unaryInterceptor := grpc_prometheus.UnaryClientInterceptor
|
||||
streamInterceptor := grpc_prometheus.StreamClientInterceptor
|
||||
cfg := config.GetGlobalConfig()
|
||||
var (
|
||||
unaryInterceptor grpc.UnaryClientInterceptor
|
||||
streamInterceptor grpc.StreamClientInterceptor
|
||||
)
|
||||
if cfg.OpenTracing.Enable {
|
||||
unaryInterceptor = grpc_middleware.ChainUnaryClient(
|
||||
unaryInterceptor,
|
||||
grpc_opentracing.UnaryClientInterceptor(),
|
||||
)
|
||||
streamInterceptor = grpc_middleware.ChainStreamClient(
|
||||
streamInterceptor,
|
||||
grpc_opentracing.StreamClientInterceptor(),
|
||||
)
|
||||
unaryInterceptor = grpc_opentracing.UnaryClientInterceptor()
|
||||
streamInterceptor = grpc_opentracing.StreamClientInterceptor()
|
||||
}
|
||||
|
||||
allowBatch := cfg.TiKVClient.MaxBatchSize > 0
|
||||
|
||||
Reference in New Issue
Block a user