diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 2dc7db9db68..7ccb3ae4365 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -84,6 +84,7 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff] - Fixing panic on prometheus collector when label has , {pull}3947[3947] - Fix MongoDB dbstats fields mapping. {pull}4025[4025] - Fixing prometheus collector to aggregate metrics based on metric family. {pull}4075[4075] +- Fixing multiEventFetch error reporting when no events are returned {pull}4153[4153] *Packetbeat* diff --git a/metricbeat/mb/module/wrapper.go b/metricbeat/mb/module/wrapper.go index b7483d27b4c..3fda4b2f393 100644 --- a/metricbeat/mb/module/wrapper.go +++ b/metricbeat/mb/module/wrapper.go @@ -255,8 +255,12 @@ func (msw *metricSetWrapper) singleEventFetch(fetcher mb.EventFetcher, reporter func (msw *metricSetWrapper) multiEventFetch(fetcher mb.EventsFetcher, reporter *eventReporter) { reporter.startFetchTimer() events, err := fetcher.Fetch() - for _, event := range events { - reporter.ErrorWith(err, event) + if len(events) == 0 { + reporter.ErrorWith(err, nil) + } else { + for _, event := range events { + reporter.ErrorWith(err, event) + } } }