Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve logging on forward failures #1037

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion flusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down