Customer is using a DQL notebook to calculate host availability. However, the results do not match the built-in Availability percentage displayed on the Host page for the same hosts and timeframe.
For the period from August 1 to September 1, 2026, Funchal KIOSK 003 shows 90.65% in DQL compared with 95.40% on the Host page, while Funchal KIOSK 002 shows 90.71% in DQL compared with 95.39% on the Host page.
The customer confirmed that there were three periods during which these hosts did not send data to Dynatrace. Outside these periods, the availability graphs appear almost continuously “up.”
The following DQL query is being used:
fetch dt.entity.host, from: "2026-07-01", to: "2026-08-01"
| filter hostGroupName == "YOUR_HOST_GROUP_NAME"
| fieldsAdd host = entity.name
| join [
timeseries m1 = max(dt.host.availability, rollup: sum),
filter: { availability.state == "up" },
by: { dt.entity.host },
interval: 1d,
from: "2026-07-01", to: "2026-08-01"
| fieldsAdd intervalToMinutes = toDouble(toLong(interval) / 60000000000)
| fieldsAdd m1_normalized = if(m1[] > intervalToMinutes, intervalToMinutes, else: m1[])
| fieldsAdd pct = arraySum(m1_normalized) / arraySize(m1_normalized) * 100 / intervalToMinutes
| fields dt.entity.host, pct
], on: { left[id] == right[dt.entity.host] }, kind: leftOuter, fields: { pct }
| fieldsAdd pct = if(isNull(pct), 0.0, else: pct)
| fields host, entity_id = id, pct
| sort pct asc
Our current theory is that the discrepancy may be caused by the query using an interval of one day and calculating the final percentage by averaging the daily availability values equally through
arraySum(m1_normalized) / arraySize(m1_normalized)
With this approach, each daily bucket contributes equally to the final result. If a no-data period occurs within a particular day, that day’s availability may be reduced significantly. Since the selected timeframe contains only about one month of daily buckets, the three affected days could lower the final DQL percentage more noticeably than the gaps visible in the availability graph suggest.
The Host page may calculate its built-in Availability percentage using a different aggregation or rollup method, which could explain why its result is approximately 4.7 percentage points higher. However, we would like to confirm whether the daily bucket aggregation and equal averaging are responsible for the difference.
Could you please clarify whether the query’s interval, rollup, normalization, or final calculation can be adjusted to align more closely with the Host page’s Availability calculation? Additionally, is some difference expected because the DQL query and the Host page use different aggregation approaches, particularly in how no-data periods are handled?