Hi,
If you are using this query, and in the Davis Anomaly metric event you’re using something like {dims:units} in the description. In Dynatrace, whenever a dimension (anything referenced via {dims:…}) changes, Davis treats it as a new problem instance.
So when the list of units changes even slightly: Old problem is closed and New problem is opened
That’s why you see constant open/close cycles.
If I correctly understand, you want to open one problem per site.
So, do not use {dims:units} anywhere (especially in description).
That makes units part of the problem key.
Use units only as a field, not a dimension.
Drive open/close behaviour via DQL:
- Alert only when units_count > 0
- Problem auto-closes when units_count = 0
Try this:
timeseries v = avg(unexpecteddowntime), by: {site, unit}
| summarize {
site_series = avg(v[]),
units = collectDistinct(unit),
units_count = countDistinct(unit)
}, by: {site, timeframe, interval}
| filter arrayMax(site_series) > 30
| filter units_count > 0
| fieldsAdd units_str = toString(units)
units_count > 0 → only then the metric event is evaluated as violating
When units_count becomes 0, the violation stops → Davis will close the problem
Then in metric event use site as a dimension, like this:
Site: {dims:site}
Affected units: {fields.units_str}