diff --git a/flusher.go b/flusher.go index 5886ef26c..8e92a465e 100644 --- a/flusher.go +++ b/flusher.go @@ -554,15 +554,26 @@ func (s *Server) forward( if ctx.Err() != nil { // We exceeded the deadline of the flush context. span.Add(ssf.Count("forward.error_total", 1, map[string]string{"cause": "deadline_exceeded"})) + entry.WithFields(logrus.Fields{ + "dropped": len(metrics), + "cause": "deadline_exceeded", + }).WithError(err).Error("Failed to forward to an upstream Veneur") } else if statErr, ok := status.FromError(err); ok && (statErr.Message() == "all SubConns are in TransientFailure" || statErr.Message() == "transport is closing") { // We could check statErr.Code() == codes.Unavailable, but we don't know all of the cases that // could return that code. These two particular cases are fairly safe and usually associated // with connection rebalancing or host replacement, so we don't want them going to sentry. span.Add(ssf.Count("forward.error_total", 1, map[string]string{"cause": "transient_unavailable"})) + entry.WithFields(logrus.Fields{ + "dropped": len(metrics), + "cause": "transient_unavailable", + }).WithError(err).Error("Failed to forward to an upstream Veneur") } else { span.Add(ssf.Count("forward.error_total", 1, map[string]string{"cause": "send"})) - entry.WithError(err).Error("Failed to forward to an upstream Veneur") + entry.WithFields(logrus.Fields{ + "dropped": len(metrics), + "cause": "send", + }).WithError(err).Error("Failed to forward to an upstream Veneur") } } else { entry.Info("Completed forward to an upstream Veneur")