elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.47k stars 8.04k forks source link

[ML] Embeddables shown on Dashboard 'Add panel' menu when ML feature not available #187007

Open peteharverson opened 2 days ago

peteharverson commented 2 days ago

The Machine Learning panel types are shown on the Dashboard 'Add panel' menu (or the new flyout-based UX) even when the ML feature privilege is None for the current space.

Screenshot 2024-06-26 at 17 33 24

If you then try to create one of the anomaly panel types, you see an error in the configuration flyout when the request is made to get the list of available jobs:

Screenshot 2024-06-26 at 17 50 16

We should check the ML capabilities when registering each embeddable type, and then check it at run time (if possible), rather than give the impression that these panel types are available.

elasticmachine commented 2 days ago

Pinging @elastic/ml-ui (:ml)

peteharverson commented 2 days ago

Note that a change point detection panel can be successfully created even when the ML feature is not available. However seeing as the AIOps Labs page is not available when ML is None, I'm thinking it should probably be hidden too. Any thoughts @darnautov ?

darnautov commented 1 day ago

However seeing as the AIOps Labs page is not available when ML is None, I'm thinking it should probably be hidden too

yes, that makes sense! I presume this bug appeared after migration to a new embeddable system. Perhaps the check for registering UI actions should verify that the anomaly detection feature is enabled.