Hi,
What you’re missing is that “3 consecutive failures” can’t be reliably expressed with violating samples or sliding windows alone, especially when you also need multi-location logic.
So, I think i find other solution, something like workaround. A practical way to model consecutive failures in DQL is to treat them as continuous failure over the evaluation window.
For a browser synthetic running every 5 minutes,
3 consecutive runs = 15 minutes of continuous failure.
You can express this in DQL by checking that all samples in the window failed, and then counting how many locations meet that condition.
Example DQL:
timeseries avail = avg(dt.synthetic.browser.availability),
by:{dt.entity.synthetic_test, dt.entity.synthetic_location},
interval:5m
| fieldsAdd syntheticName = entityName(dt.entity.synthetic_test)
| fieldsAdd locationName = entityName(dt.entity.synthetic_location)
| filter syntheticName == "<synthetic name>"
| fieldsAdd
samples = arraySize(avail),
maxAvail = arrayMax(avail)
| filter samples >= 3
| filter maxAvail < 1
| summarize
failing_locations = count(),
by:{dt.entity.synthetic_test}
| filter failing_locations >= 2
arrayMax(avail) < 1 guarantees there was no successful execution in the window → truly consecutive failures
samples >= 3 ensures at least 3 runs were evaluated
failing_locations >= 2 enforces the multi-location condition
In Davis Anomaly Detection, configure:
Evaluation window: 15 minutes
Evaluation frequency: 5 minutes
Trigger condition: Result exists
No sliding window / violating samples needed
Try this and give me feedback. I test it, but I don’t have test with 3 failures.