move time.Now

This commit is contained in:
Gorbunov Kirill Andreevich 2024-09-20 17:42:01 +03:00
parent 661e80331a
commit 1f033505f6

@ -200,7 +200,6 @@ func (g *Server) getGrpcOptions() []grpc.ServerOption {
func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error {
var err error
ts := time.Now()
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")
}
ts := time.Now()
var sp tracer.Span
if !slices.Contains(tracer.DefaultSkipEndpoints, fullMethod) {
ctx, sp = g.opts.Tracer.Start(ctx, fullMethod+" rpc-server",