elastic / kibana

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

[ML] Dashboard with ML embeddable breaks when exporting/copying #128892

Open jportner opened 2 years ago

jportner commented 2 years ago

Kibana version:

Tested in latest main (8.2)

Describe the bug:

You can add ML embeddables to a dashboard:

image

However, it appears that the ML job ID is not stored as a saved object reference, it is stored within the panel JSON itself. Kibana will let you copy the dashboard into another space, and the dashboard will be broken because the job doesn't exist there. This isn't a great UX, we should put some guard rails around this.

Steps to reproduce:

  1. Start Kibana and log in
  2. Navigate to Home, then add sample data
  3. Navigate to Machine Learning, then create a new anomaly detection job
  4. Navigate to Stack Management -> Spaces, then create a new space
  5. Navigate to Stack Management -> Saved Objects, then copy the dashboard to the new space
  6. Enter the new space
  7. Navigate to the newly copied dashboard and observe that it is broken

Expected behavior:

We could detect when the user is attempting to export or copy a dashboard that contains an ML embeddable. In that case we could warn the user, or (in the case of copy) offer for the user to share the ML job to the destination space(s). In the future, when dashboards are shareable, we could prompt the user to share the entire dashboard instead of copying it.

Screenshots (if relevant): image

elasticmachine commented 2 years ago

Pinging @elastic/ml-ui (:ml)