Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

sayden
Copy link
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
Contributor Author

sayden commented Feb 28, 2019

Error seems unrelated

Copy link
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.

metricbeat/module/mongodb/dbstats/dbstats.go Show resolved Hide resolved
continue
}
data, _ := schema.Apply(result)
events = append(events, data)
reporter.Event(mb.Event{MetricSetFields: data})
Copy link
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
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
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.

continue
}
data, _ := schema.Apply(result)
events = append(events, data)
if reported := reporter.Event(mb.Event{MetricSetFields: data}); !reported {
logger.Error("error reporting event")
Copy link
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
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