diff --git a/rpc/server.go b/rpc/server.go index cc9150d0..598cbb89 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -338,7 +338,7 @@ func NewServer(logger utils.ZapCompatibleLogger, opts ...ServerOption) (Server, grpcUnaryServerInterceptor(logger), unaryServerCodeInterceptor(), ) - unaryInterceptors = append(unaryInterceptors, UnaryServerTracingInterceptor(logger)) + unaryInterceptors = append(unaryInterceptors, UnaryServerTracingInterceptor()) unaryAuthIntPos := -1 if !sOpts.unauthenticated { unaryInterceptors = append(unaryInterceptors, server.authUnaryInterceptor) @@ -371,7 +371,7 @@ func NewServer(logger utils.ZapCompatibleLogger, opts ...ServerOption) (Server, grpcStreamServerInterceptor(logger), streamServerCodeInterceptor(), ) - streamInterceptors = append(streamInterceptors, StreamServerTracingInterceptor(logger)) + streamInterceptors = append(streamInterceptors, StreamServerTracingInterceptor()) streamAuthIntPos := -1 if !sOpts.unauthenticated { streamInterceptors = append(streamInterceptors, server.authStreamInterceptor) diff --git a/rpc/server_interceptors.go b/rpc/server_interceptors.go index eb149c47..bd00e815 100644 --- a/rpc/server_interceptors.go +++ b/rpc/server_interceptors.go @@ -22,7 +22,7 @@ import ( ) // UnaryServerTracingInterceptor starts a new Span if Span metadata exists in the context. -func UnaryServerTracingInterceptor(logger utils.ZapCompatibleLogger) grpc.UnaryServerInterceptor { +func UnaryServerTracingInterceptor() grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if remoteSpanContext, err := remoteSpanContextFromContext(ctx); err == nil { var span *trace.Span @@ -45,7 +45,7 @@ func UnaryServerTracingInterceptor(logger utils.ZapCompatibleLogger) grpc.UnaryS } // StreamServerTracingInterceptor starts a new Span if Span metadata exists in the context. -func StreamServerTracingInterceptor(logger utils.ZapCompatibleLogger) grpc.StreamServerInterceptor { +func StreamServerTracingInterceptor() grpc.StreamServerInterceptor { return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { if remoteSpanContext, err := remoteSpanContextFromContext(stream.Context()); err == nil { newCtx, span := trace.StartSpanWithRemoteParent(stream.Context(), "server_root", remoteSpanContext)