# Cannot read properties of undefined (reading 'metrics) error for Davis forecast

**URL:** <https://community.dynatrace.com/t/cannot-read-properties-of-undefined-reading-metrics-error-for-davis-forecast/51276>\
**Category:** Dashboarding\
**Tags:** dql, davis, anomaly-detection, dashboards\
**Created:** [April 17, 2025, 11:53am UTC](https://community.dynatrace.com/t/cannot-read-properties-of-undefined-reading-metrics-error-for-davis-forecast/51276 "2025-04-17T11:53:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marina\_pollehn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marina_pollehn/32/39120_2.png) [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Post date:** [April 17, 2025, 11:53am UTC](https://community.dynatrace.com/t/cannot-read-properties-of-undefined-reading-metrics-error-for-davis-forecast/51276/1 "2025-04-17T11:53:13Z")

</div>

Hi all,

I am running this query, so far so good, it works.

timeseries avg(dt.host.disk.used.percent), interval:2h, by: { host.name, dt.entity.host\_group, dt.entity.disk }  
, filter: { matchesValue(entityAttr(dt.entity.host\_group, “entity.name”), $HostGroup) }  
| fieldsAdd dt.entity.host\_group.name = entityName(dt.entity.host\_group),dt.entity.disk.name = entityName(dt.entity.disk)  
| fieldsAdd array\_max = arrayMax(`avg(dt.host.disk.used.percent)`)  
| filterOut array\_max \< toDouble($disk\_threshold)

The $ signs are the variables defined in my dashboard. You can replace them with a host group name you have and a random disk threshold, for example 70.

 ![marina_pollehn_0-1744890997625.png](https://global.discourse-cdn.com/dynatrace/original/2X/f/f078c80f580ce9520b276d1cb3d943bb879b670b.png)

Nevertheless, when I switch to the Davis forecaster, I get this error message. Even if I only want to predict one datapoint I see this message (yes I have more than 1 datapoint) and the refresh icon keeps on spinning (tiles are being loaded). Am I looking at a bug or am I doing something wrong?

 ![marina_pollehn_0-1744890602270.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/04c9506c6cd9e7f4dc6070d152b4f49a466c5953.png)

I checked with different timeframes and intervals, if I use a small recent timeframe, it works. Is the disk with the single data point (first image, blue dot) crashing the forecaster? This should not happen, right?

---

<div class="post-metadata">

**Author:** ![marina\_pollehn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marina_pollehn/32/39120_2.png) [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Post date:** [April 17, 2025, 8:15pm UTC](https://community.dynatrace.com/t/cannot-read-properties-of-undefined-reading-metrics-error-for-davis-forecast/51276/2 "2025-04-17T20:15:59Z")

</div>

Okay I solved my own problem :D. The single datapoint of a disk that was only present for a moment kills the analyzer. So if I want to predict the next 7 days based on the last 7, I will need to filter out all disks which do not have sufficient data. As I use 2 hour intervals and 7 days have 84 2-hour intervals, I will filter out all disks with an array size \< 84. To be honest, I still consider this a bug which should be fixed though.

timeseries avg(dt.host.disk.used.percent), interval:2h, by: { host.name, dt.entity.host\_group, dt.entity.disk }  
, filter: { matchesValue(entityAttr(dt.entity.host\_group, “entity.name”), $HostGroup) }  
| fieldsAdd dt.entity.host\_group.name = entityName(dt.entity.host\_group),dt.entity.disk.name = entityName(dt.entity.disk)  
| fieldsAdd array\_max = arrayMax(avg(dt.host.disk.used.percent))  
| filterOut array\_max \< toDouble($disk\_threshold)  
| filterOut arraySize(avg(dt.host.disk.used.percent))\<84
