Skip to content

Commit

Permalink
Fixing multiEventFetch error reporting when no events are returned (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vjsamuel authored and ruflin committed May 1, 2017
1 parent 2dbdb1d commit d3d1407
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
8 changes: 6 additions & 2 deletions metricbeat/mb/module/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit d3d1407

Please sign in to comment.