Skip to content

fix: "All Values" over time could fire on a single probe (#2321)#2582

Open
FreZZZeR wants to merge 1 commit into
OneUptime:masterfrom
FreZZZeR:fix/evaluate-over-time-all-values-window
Open

fix: "All Values" over time could fire on a single probe (#2321)#2582
FreZZZeR wants to merge 1 commit into
OneUptime:masterfrom
FreZZZeR:fix/evaluate-over-time-all-values-window

Conversation

@FreZZZeR

@FreZZZeR FreZZZeR commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #2321.

Problem

Evaluate over time with "All Values" was matching even when there was only one
sample in the window. [x].every(...) on a one-element array is always true,
and when the window had no data the code fell back to the current probe value —
which ignores the "over time" part completely. So a single failing probe could
open an incident (or flip monitor status) instead of waiting the configured
minutes. Reported in #2321 on 9.5.0 and 10.0.17; still reproducible on 11.3.16.

Root cause

  • EvaluateOverTime.getValueOverTime returns the raw sample array and the
    comparison uses Array.every() — trivially true for a single sample.
  • The probe criteria fall back to the instantaneous value when the window is empty.
  • The status/incident decision goes through checkProbeAgreement, which
    re-evaluates and can see a different window than the summary shown to the
    user, so the visible breakdown ("not met") and the action ("met") can disagree.

Fix

  • Add onNoDataPolicy to the evaluate-over-time options, reusing the existing
    NoDataPolicy (default Ignore) that metric monitors already use — "no data"
    no longer means "use the current value".
  • New EvaluateOverTime.resolveFilterOverTime() requires the window to be
    actually covered before "All Values" can match. Expected sample count is
    derived from the monitor's monitoringInterval (cron); if the interval is
    unknown/irregular it falls back to checking the oldest sample reaches near the
    window start. "Any Value" still matches on a single sample by design.
  • monitoringInterval is threaded from MonitorCriteriaEvaluator to all probe
    criteria (API, Server, DNS, SSL, Incoming Request, External Status Page, SNMP).
    getValueOverTime is kept intact for backward compatibility.

Tests

  • EvaluateOverTime.hasSufficientWindowCoverage — single sample vs full window,
    jitter tolerance, coarse interval, and the no-interval fallback.
  • CronTab.getIntervalInMinutes.

Verified locally: compile (tsc), jest, eslint and prettier all pass.

Notes

)

Evaluate over time with "All Values" was matching even with one sample in the
window. every() on a one-element array is always true, and when the window had
no data we fell back to the current probe value, which basically ignores the
"over time" part. Result: one failing probe could open an incident instead of
waiting the configured minutes.

Changes:
- add onNoDataPolicy to the over-time options (reuses existing NoDataPolicy,
  default Ignore) so "no data" is not treated as the current value anymore.
- resolveFilterOverTime now requires the window to be actually covered before
  "All Values" can match. Expected sample count is taken from the monitor
  interval (cron); if the interval is unknown it falls back to checking the
  oldest sample reaches near the window start.
- pass monitoringInterval from MonitorCriteriaEvaluator to the probe criteria
  (api, server, dns, ssl, incoming request, external status page, snmp).
- tests for the coverage check and the cron interval helper.
- short note in monitor docs.
@simlarsen

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@FreZZZeR

FreZZZeR commented Jul 6, 2026

Copy link
Copy Markdown
Author

Hello guys!
Any questions are there? I'm ready to fix it if it exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terraform Monitor Criteria evaluateOverTime not waiting

2 participants