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

Use default metricsets in hints based autodiscover #6634

Merged
merged 3 commits into from
Mar 26, 2018

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Mar 22, 2018

When using hints in Metricbeat, follow this pattern:

  • If metricsets hint is given, use it
  • If not, use module default metricsets
  • If no default metricsets, use all module metricsets

@exekias exekias added review containers Related to containers use case labels Mar 22, 2018
@exekias
Copy link
Contributor Author

exekias commented Mar 22, 2018

I've opened #6636 to still support the now unhardcoded Prometheus use case

@ruflin ruflin added the Metricbeat Metricbeat label Mar 23, 2018
Copy link
Contributor

@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.

+1 on the feature. The only worry I have is about the experimental and beta metricsets but our discussion about the defaults should solve this before a release.

Could you also add a note about the defaults to the docs?

// fallback to all metricsets if module has no defaults
msets, err = m.Registry.DefaultMetricSets(module)
if err != nil || len(msets) == 0 {
msets = m.Registry.MetricSets(module)
Copy link
Contributor

Choose a reason for hiding this comment

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

I worry that with that we enable experimental metricsets which is probably not our intention.

Copy link
Member

@jsoriano jsoriano Mar 23, 2018

Choose a reason for hiding this comment

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

Could we exclude experimental metricsets from defaults? Is there an alternative way to explicitly enable metricsets from hints?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we agree to set default metricsets for all modules? If that's the case this is not a issue

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, we do. but if we merge this we should make sure then that we follow up with the changes until the next release.

Copy link
Contributor Author

@exekias exekias Mar 23, 2018

Choose a reason for hiding this comment

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

Well, having that this feature is experimental... we could probably live with experimental metricsets being spawned here 😇

"enabled": true,
},
},
// Only module, it should return defaults
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a comment here you could add this as message or description to the test and output it when the test fails. This makes hunting down a failing test much easier. We have that already in quite a few other places.

@exekias
Copy link
Contributor Author

exekias commented Mar 23, 2018

Tests and docs updated

Carlos Pérez-Aradros Herce added 3 commits March 26, 2018 12:24
When using hints in Metricbeat, follow this pattern:

 - If `metricsets` hint is given, use it
 - If not, use module default metricsets
 - If no default metricsets, use all module metricsets
@exekias exekias force-pushed the unhardcode-prometheus branch from f3de048 to 3bd95df Compare March 26, 2018 10:24
Copy link
Contributor

@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.

WFG

@ruflin ruflin merged commit 47bd6a0 into elastic:master Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Related to containers use case Metricbeat Metricbeat review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants