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
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Allow to configure Kafka fetching strategy for the topic metadata. {pull}10682[10682]
- Using an environment variable for the password when enrolling a beat will now raise an error if the variable doesn't exist. {pull}10936[10936]
- Add missing `host.containerized` and `host.os.build` to fields.ecs.yml. {pull}11016[11016]
- Reconnections of Kubernetes watchers are now logged at debug level when they are harmless. {pull}10988[10988]

*Auditbeat*

Expand Down
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.Info("kubernetes: Unexpected EOF while watching API")
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