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] Force metricsets to implement a Close()? #11266

Closed
fearful-symmetry opened this issue Mar 15, 2019 · 2 comments
Closed

[Metricbeat] Force metricsets to implement a Close()? #11266

fearful-symmetry opened this issue Mar 15, 2019 · 2 comments
Assignees
Labels
discuss Issue needs further discussion. Metricbeat Metricbeat Team:Integrations Label for the Integrations team

Comments

@fearful-symmetry
Copy link
Contributor

Summarizing some discussions I had with @kaiyan-sheng and @ruflin

Right now metricbeat provides a Closer interface that metricsets can implement. However, not all metricsets need a Close() obviously. However, I'm beginning to wonder if some things slipped under the radar. I can't find where the docker/container metricset closes it's client handler, for example:

client, err := docker.NewDockerClient(base.HostData().URI, config)

We have something like 155 metricsets, and it's easy for this kinda thing to slip unnoticed. I wonder if we should make Close() part of the ReporterV2 interface, and metricsets that don't need it can simply no op it. This may result in some extra code, but it could aid in auditing and consistency across the metricsets. Thoughts? Opinions?

@fearful-symmetry fearful-symmetry added discuss Issue needs further discussion. Metricbeat Metricbeat technical_debt labels Mar 15, 2019
@kaiyan-sheng kaiyan-sheng added the Team:Integrations Label for the Integrations team label Mar 15, 2019
@ruflin
Copy link
Contributor

ruflin commented Mar 18, 2019

Initially we had a Close() method required but realised for a lot of metricsets it was not needed why we tried to lower the bar of entry and made it opt in. I definitively see the point of making it required to rise awareness but not sure if it's going to solve the problem. My suggestion is to keep it as is for now but make sure we revisit our own metricset to check if all close connections as expected.

@exekias
Copy link
Contributor

exekias commented May 8, 2019

It seems #11981 will go in, in some cases it should be enough with using it instead of waiting for a Close call?

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

No branches or pull requests

5 participants