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

Log EOFs found on Kubernetes watcher at debug level #10988

Merged
Merged
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions libbeat/common/kubernetes/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,17 @@ func (w *watcher) watch() {
r := w.k8sResourceFactory()
eventType, err := watcher.Next(r)
if err != nil {
logp.Err("kubernetes: Watching API error %v", err)
watcher.Close()
if !(err == io.EOF || err == io.ErrUnexpectedEOF) {
switch err {
case io.EOF:
logp.Debug("kubernetes", "EOF while watching API")
case io.ErrUnexpectedEOF:
logp.Warn("kubernetes: Unexpected EOF while watching API")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically we tried not to use Warn but Error or Info to make it clear if action is needed or not. I'm tempted to think this should be logged on Info level as no action is needed normally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, changed to Info 👍

default:
// This is an error event which can be recovered by moving to the latest resource version
logp.Info("kubernetes: Ignoring event, moving to most recent resource version")
logp.Err("kubernetes: Watching API error %v, ignoring event and moving to most recent resource version", err)
w.lastResourceVersion = ""

}
break
}
Expand Down