elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.05k stars 4.89k forks source link

[Elasticsearch-xpack] [Metricbeat] Fix elasticsearch-xpack error when Machine Learning is explicitly disabled #39990

Open jennypavlova opened 1 week ago

jennypavlova commented 1 week ago

Closes #28087

Proposed commit message

This PR fixes elasticsearch-xpack error when Machine Learning is explicitly disabled by checking if the Machine Learning is enabled

Checklist

Disruptive User Impact

Author's Checklist

How to test this PR locally

Related issues

-

Use cases

Screenshots

Logs

mergify[bot] commented 1 week ago

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @jennypavlova? 🙏. For such, you'll need to label your PR with:

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

botelastic[bot] commented 1 week ago

This pull request doesn't have a Team:<team> label.

jennypavlova commented 1 week ago

@klacabane Thank you for the review! I fixed the comments and the test and don't see the error when xpack.ml.enabled is set to false. I would need some help with the linting errors (I tried some formatters and tips I found but nothing worked so far) and testing with the actual ML job running locally (the case when the ML is enabled in elasticsearch - I am not sure what the expected log is in this case and if any additional configuration is needed).