elastic / kibana

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

[ML] Error getting metric data Cannot read properties of undefined (reading '0') on single metric viewer when user navigates from anomaly explorer page->annotations -> job model snapshots -> single metric viewer #181910

Closed bhavyarm closed 6 days ago

bhavyarm commented 1 week ago

Kibana version: 8.14.0/8.13.3

Browser version: chrome latest

Describe the bug: Kibana ML displays error getting metric data cannot read properties of undefined (reading 0) error when user clicks on single metric viewer on job model snapshots listed under annotations.

Steps to reproduce:

  1. Click on anomaly explorer and select a job
  2. On the job page, expand below annotations and select model snapshot stored
  3. ML will display the annnotations. Click on single metric viewer on the annotation
  4. ML displays "Error getting metric data Cannot read properties of undefined (reading '0')

Screenshots (if relevant):

Screenshot 2024-04-27 at 12 00 19 AM Screenshot 2024-04-26 at 11 46 51 PM
elasticmachine commented 1 week ago

Pinging @elastic/ml-ui (:ml)

peteharverson commented 1 week ago

From a quick look, there might be an issue with undefined focusRange` in https://github.com/elastic/kibana/blob/main/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js#L438.

While testing this, I also noticed that the hover on anomalies in the table no longer highlights the corresponding anomaly marker in the chart, with this error in the console:

Screenshot 2024-04-29 at 12 12 17