diff --git a/go.mod b/go.mod index 234034a2a0..d6140988c2 100644 --- a/go.mod +++ b/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 diff --git a/store/tikv/client.go b/store/tikv/client.go index 6b8f69aa44..b514525ddd 100644 --- a/store/tikv/client.go +++ b/store/tikv/client.go @@ -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