diff --git a/server/etcdserver/api/v3rpc/grpc.go b/server/etcdserver/api/v3rpc/grpc.go index ed55e0357c9f..efa151437d39 100644 --- a/server/etcdserver/api/v3rpc/grpc.go +++ b/server/etcdserver/api/v3rpc/grpc.go @@ -67,8 +67,7 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config, interceptor grpc.UnarySer } if s.Cfg.EnableDistributedTracing { - chainUnaryInterceptors = append(chainUnaryInterceptors, otelgrpc.UnaryServerInterceptor(s.Cfg.TracerOptions...)) - chainStreamInterceptors = append(chainStreamInterceptors, otelgrpc.StreamServerInterceptor(s.Cfg.TracerOptions...)) + opts = append(opts, grpc.StatsHandler(otelgrpc.NewServerHandler(s.Cfg.TracerOptions...))) } opts = append(opts, grpc.ChainUnaryInterceptor(chainUnaryInterceptors...)) diff --git a/tests/integration/tracing_test.go b/tests/integration/tracing_test.go index 74f231a3aba4..830ffb0b6461 100644 --- a/tests/integration/tracing_test.go +++ b/tests/integration/tracing_test.go @@ -89,8 +89,7 @@ func TestTracing(t *testing.T) { } dialOptions := []grpc.DialOption{ - grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor(tracingOpts...)), - grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor(tracingOpts...)), + grpc.WithStatsHandler(otelgrpc.NewClientHandler(tracingOpts...)), } ccfg := clientv3.Config{DialOptions: dialOptions, Endpoints: []string{cfg.AdvertiseClientUrls[0].String()}} cli, err := integration.NewClient(t, ccfg)