diff --git a/protocol/grpc/client.go b/protocol/grpc/client.go index 038bf93118f1d9dc555377a7d068cfe285147ce7..0f7651ed24f349488f9a2280c45b85ccf63cdb3d 100644 --- a/protocol/grpc/client.go +++ b/protocol/grpc/client.go @@ -53,7 +53,10 @@ func NewClient(url common.URL) *Client { if opentracing.IsGlobalTracerRegistered() { tracer = opentracing.GlobalTracer() conn, err = grpc.Dial(url.Location, grpc.WithInsecure(), grpc.WithBlock(), - grpc.WithUnaryInterceptor(otgrpc.OpenTracingClientInterceptor(tracer))) + grpc.WithUnaryInterceptor( + otgrpc.OpenTracingClientInterceptor(tracer, otgrpc.LogPayloads())), + grpc.WithStreamInterceptor( + otgrpc.OpenTracingStreamClientInterceptor(tracer, otgrpc.LogPayloads()))) if err != nil { panic(err) } diff --git a/protocol/grpc/server.go b/protocol/grpc/server.go index 83dab37ed24f4fd01e8c4ef5d39a9fb9e134b53e..5574388f7709587c00f0916687530e31b835c94b 100644 --- a/protocol/grpc/server.go +++ b/protocol/grpc/server.go @@ -73,7 +73,9 @@ func (s *Server) Start(url common.URL) { // if global trace instance was set, then server tracer instance can be get, and span context can also be get if opentracing.IsGlobalTracerRegistered() { tracer := opentracing.GlobalTracer() - server = grpc.NewServer(grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer))) + server = grpc.NewServer( + grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)), + grpc.StreamInterceptor(otgrpc.OpenTracingStreamServerInterceptor(tracer))) } else { server = grpc.NewServer() }