Skip to content

Commit

Permalink
Fix event time calculation on docker events (#24318) (#24320)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8b673e6)
  • Loading branch information
ChrsMark authored Mar 3, 2021
1 parent 84c14fb commit 7e465a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix CPU usage metrics on VMs with dynamic CPU config {pull}23154[23154]
- Fix panic due to unhandled DeletedFinalStateUnknown in k8s OnDelete {pull}23419[23419]
- Fix error loop with runaway CPU use when the Kafka output encounters some connection errors {pull}23484[23484]
- Fix issue discovering docker containers and metadata after reconnections {pull}24318[24318]


*Auditbeat*
Expand Down
6 changes: 5 additions & 1 deletion libbeat/common/docker/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ func (w *watcher) watch() {
select {
case event := <-events:
w.log.Debugf("Got a new docker event: %v", event)
lastValidTimestamp = time.Unix(event.Time, event.TimeNano)
if event.TimeNano > 0 {
lastValidTimestamp = time.Unix(0, event.TimeNano)
} else {
lastValidTimestamp = time.Unix(event.Time, 0)
}
lastReceivedEventTime = w.clock.Now()

switch event.Action {
Expand Down

0 comments on commit 7e465a6

Please sign in to comment.