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] documenting/standardizing the return of r.Event #11666

Closed
fearful-symmetry opened this issue Apr 5, 2019 · 9 comments
Closed

[Metricbeat] documenting/standardizing the return of r.Event #11666

fearful-symmetry opened this issue Apr 5, 2019 · 9 comments
Assignees
Labels
discuss Issue needs further discussion. docs Metricbeat Metricbeat Team:Integrations Label for the Integrations team

Comments

@fearful-symmetry
Copy link
Contributor

This came up during a discussion with @ruflin and he asked me to file an issue.

So, there's some inconsistency about how we handle the bool that gets returned from reporter.Event(). This will only return false if the metricset has closed.

The vast majority of metricsets ignore this, however a few check the value and log an error:

./ceph/cluster_disk/cluster_disk.go:77: if reported := reporter.Event(mb.Event{MetricSetFields: event}); !reported {
./mongodb/dbstats/dbstats.go:89:                reported := reporter.Event(mb.Event{MetricSetFields: data})
./kubernetes/state_container/state_container.go:144:            if reported := reporter.Event(mb.Event{
./kubernetes/state_replicaset/state_replicaset.go:116:          if reported := reporter.Event(mb.Event{
./kubernetes/state_deployment/state_deployment.go:117:          if reported := reporter.Event(mb.Event{
./kubernetes/state_statefulset/state_statefulset.go:115:                if reported := reporter.Event(mb.Event{

How should we standardize and document this? A blurb in the beats developer docs would be helpful, at least.

@fearful-symmetry fearful-symmetry added docs discuss Issue needs further discussion. Metricbeat Metricbeat labels Apr 5, 2019
@fearful-symmetry fearful-symmetry self-assigned this Apr 5, 2019
@kaiyan-sheng kaiyan-sheng changed the title [Meticbeat] documenting/standardizing the return of r.Eevent [Meticbeat] documenting/standardizing the return of r.Event Apr 7, 2019
@ruflin ruflin added the Team:Integrations Label for the Integrations team label Apr 8, 2019
@fearful-symmetry fearful-symmetry changed the title [Meticbeat] documenting/standardizing the return of r.Event [Metricbeat] documenting/standardizing the return of r.Event Apr 8, 2019
@jsoriano
Copy link
Member

jsoriano commented Apr 8, 2019

@fearful-symmetry look at this thread for a related discussion: #9907 (comment)

Some ideas from there:

  • This returned value should be used to stop doing anymore work in fetchers that send multiple events
  • This can be completely ignored in fetchers that only send an event per fetch
  • If anything is logged, it should be done at the debug level, as this is something expected to happen

@ruflin
Copy link
Contributor

ruflin commented Apr 9, 2019

++ on the above. I'm even wondering if we should log something on the debug level as I'm pretty sure something else logs already on the debug level that sending was interrupted / metricset was stopped.

Now we need to document the above somewhere in the Metricbeat modules dev docs. @fearful-symmetry Want to take this on?

@fearful-symmetry
Copy link
Contributor Author

@ruflin sure!

@fearful-symmetry
Copy link
Contributor Author

This also sorta ties into the "best practices" I mention in #11102

@fearful-symmetry
Copy link
Contributor Author

This should be covered by #11745

@ruflin
Copy link
Contributor

ruflin commented Apr 11, 2019

@fearful-symmetry Should we close the issue?

@fearful-symmetry
Copy link
Contributor Author

@ruflin unless you think there's additional documentation needed not covered by #11745, we should be good to close it.

I also have a lurking suspicion that there's a few metricsets not using the bool value inside a loop, but that can be another case/PR if I run across them.

@fearful-symmetry
Copy link
Contributor Author

fearful-symmetry commented Apr 11, 2019

Okay, so I did gather a list of metricsets that call Event() in a loop but don't check the return to see if the metricset is closed. These probably aren't too urgent, but maybe worth tracking

@ruflin
Copy link
Contributor

ruflin commented Apr 15, 2019

@fearful-symmetry I would say let's close it but have the list you collected above in a separate issue, otherwise we keep extending the scope of this issue which was only around docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. docs Metricbeat Metricbeat Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

3 participants