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 Aerospike namespace Metricset to use ReporterV2 interface #10984

Merged

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Feb 28, 2019

Refer to #10774 for more info

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

sayden commented Mar 1, 2019

@sayden sayden added the review label Mar 1, 2019
@@ -98,11 +100,11 @@ func (m *MetricSet) Fetch() ([]common.MapStr, error) {
"name": node.GetName(),
}

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.

We could interrupt this loop to avoid further queries if reporter.Event() is returning false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that a good idea? I mean, let's face some examples:

  • Sending 100 events and 1 of them failed because of a network issue (for the purpose of the example). 99 events would arrive.
  • 1 event failed so I don't send the next 99.
  • 100 event fails and we have 100 error messages. While they are not harmful, it is a bit annoying to receive 100 times the same error message. 100 events didn't arrive, of course.
  • A mix, where we only send some of the events and some not mixed with some error messages.

So, my assumption after you comment is that we prefer to get those 99 events and produce an error message in each case.

WDYT? 🙂

Copy link
Member

Choose a reason for hiding this comment

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

The thing is that it doesn't return false because of a network issue, it returns false in a totally deterministic way if the metricset has been stopped, and in that case all the following calls will also fail. Following with your example, if you have 100 namespaces, and the second one fails to be reported, the other 97 will also fail, so it does 97 requests for namespace metrics that are not going to be reported.

Remember this thread.

In any case I think this is not such a big deal, so as you prefer, but I find the possibility of handling this as an advantage of using reporter V2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I completely forgot about that thread. I just wanted to be sure that we were taking into account all possible scenarios. I'll modify it. Thanks Jaime 🙂

@ruflin
Copy link
Member

ruflin commented Mar 13, 2019

jenkins, test this

@ruflin
Copy link
Member

ruflin commented Mar 13, 2019

@sayden Seeing this PR is approved do you plan to merge it?

@sayden sayden force-pushed the migration/mb/reporterv2/aerospike/namespace branch from 638df4d to 4061393 Compare March 13, 2019 11:58
@sayden
Copy link
Contributor Author

sayden commented Mar 13, 2019

I took advantage to add the error interface too. I couldn't use the new testing framework here.

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

jenkins, test this

@sayden sayden merged commit 7982422 into elastic:master Mar 26, 2019
@sayden sayden deleted the migration/mb/reporterv2/aerospike/namespace branch December 18, 2020 12:26
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.

4 participants