diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go index 740422e4f67..86148e7ede7 100644 --- a/pkg/gateway/lb/handler/grpc/handler.go +++ b/pkg/gateway/lb/handler/grpc/handler.go @@ -1904,13 +1904,12 @@ func (s *server) MultiUpdate( } if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } - errs = err } return locs, errs @@ -2735,13 +2734,12 @@ func (s *server) MultiRemove( } if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } - errs = err } return locs, errs