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

Cherry-pick #12816 to 7.2: [Metricbeat] Avoid omitting of errors in Vsphere module and upgrade to use context.Context #13004

Merged
merged 4 commits into from
Aug 2, 2019

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Jul 22, 2019

Cherry-pick of PR #12816 to 7.2 branch. Original message:

Some potential error checks are being omitted in vSphere module. They aren't probably key to fetch metrics but they may be hiding important debug information when things go wrong.

This PR prints in debug level if any of those errors have returned information.

At the same time, the PR is upgraded to use context.Contextin Fetch method, recently added to Beats and it may be useful as a background context was being used on the Metricsets.

@sayden sayden requested a review from a team as a code owner July 22, 2019 11:04
@sayden sayden self-assigned this Jul 23, 2019

if err := mbtest.WriteEventsReporterV2Error(f, t, ""); err != nil {
if err := mbtest.WriteEventsReporterV2WithContext(f, t, ""); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

WriteEventsReporterV2WithContext seems to be undefined for 7.2, maybe we should keep WriteEventsReporterV2Error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ Yeap, good catch 😬

@sayden sayden force-pushed the backport_12816_7.2 branch from d74756a to de110a0 Compare July 30, 2019 21:55
@sayden
Copy link
Contributor Author

sayden commented Aug 2, 2019

Error seems unrelated, merging

@sayden sayden merged commit 93e0795 into elastic:7.2 Aug 2, 2019
@sayden sayden deleted the backport_12816_7.2 branch October 29, 2021 08:57
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…rs in Vsphere module and upgrade to use context.Context (elastic#13004)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants