#348 add check method in should be skipped #175

Merged
vtolstov merged 3 commits from kgorbunov/micro-server-grpc:#348-v3 into v3 2024-09-20 17:43:08 +03:00
Showing only changes of commit 1f033505f6 - Show all commits

View File

@ -200,7 +200,6 @@ func (g *Server) getGrpcOptions() []grpc.ServerOption {
func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error { func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error {
var err error var err error
ts := time.Now()
ctx := stream.Context() ctx := stream.Context()
@ -209,6 +208,7 @@ func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error {
return status.Errorf(codes.Internal, "method does not exist in context") return status.Errorf(codes.Internal, "method does not exist in context")
} }
ts := time.Now()
var sp tracer.Span var sp tracer.Span
if !slices.Contains(tracer.DefaultSkipEndpoints, fullMethod) { if !slices.Contains(tracer.DefaultSkipEndpoints, fullMethod) {
ctx, sp = g.opts.Tracer.Start(ctx, fullMethod+" rpc-server", ctx, sp = g.opts.Tracer.Start(ctx, fullMethod+" rpc-server",