Skip to content

[Metricbeat] Migrate MongoDB dbstats Metricset to use ReporterV2 interface#10852

Merged
sayden merged 4 commits intoelastic:masterfrom
sayden:migration/mb/reporterv2/mongodb/dbstats
Mar 6, 2019
Merged

[Metricbeat] Migrate MongoDB dbstats Metricset to use ReporterV2 interface#10852
sayden merged 4 commits intoelastic:masterfrom
sayden:migration/mb/reporterv2/mongodb/dbstats

Conversation

@sayden
Copy link
Copy Markdown
Contributor

@sayden sayden commented Feb 20, 2019

Refer to #10774 for more info

@sayden sayden added Metricbeat Metricbeat Team:Integrations Label for the Integrations team labels Feb 20, 2019
@sayden sayden self-assigned this Feb 20, 2019
@sayden sayden requested a review from a team as a code owner February 20, 2019 21:57
@sayden sayden added the review label Feb 28, 2019
@sayden
Copy link
Copy Markdown
Contributor Author

sayden commented Feb 28, 2019

Error seems unrelated

Copy link
Copy Markdown
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a suggestion and a question.

}
data, _ := schema.Apply(result)
events = append(events, data)
reporter.Event(mb.Event{MetricSetFields: data})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result of reporter.Event() could be checked here to avoid continuing doing queries when the metricset is being stopped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sayden
Copy link
Copy Markdown
Contributor Author

sayden commented Mar 6, 2019

Error in ES module seems unrelated, merging

@sayden sayden merged commit 360fe0d into elastic:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Metricbeat Metricbeat review Team:Integrations Label for the Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants