[Metricbeat] Migrate MongoDB dbstats Metricset to use ReporterV2 interface#10852
Conversation
|
Error seems unrelated |
jsoriano
left a comment
There was a problem hiding this comment.
LGTM, just a suggestion and a question.
| } | ||
| data, _ := schema.Apply(result) | ||
| events = append(events, data) | ||
| reporter.Event(mb.Event{MetricSetFields: data}) |
There was a problem hiding this comment.
Result of reporter.Event() could be checked here to avoid continuing doing queries when the metricset is being stopped.
There was a problem hiding this comment.
I have the same concerns than here. I really don't have a strong opinion anyways but I think it's good that we reach consensus for this in the future.
There was a problem hiding this comment.
I think we already had some kind of consensus 🙂 but as replied in the other PR I don't see this as such a big deal, so as you prefer.
| data, _ := schema.Apply(result) | ||
| events = append(events, data) | ||
| if reported := reporter.Event(mb.Event{MetricSetFields: data}); !reported { | ||
| logger.Error("error reporting event") |
There was a problem hiding this comment.
Notice that this is not an error, this is expected to happen when modules are stopped and we should not alert the user because of that.
In other places we are logging this at the debug level, and just in case we have to investigate something weird around this.
|
Error in ES module seems unrelated, merging |
Refer to #10774 for more info