Alert flapping from insufficient recovery window duration
0 reputation · 04 Feb 2022, 19:24 UTC
0 reputation · 04 Feb 2022, 19:24 UTC
New Relic alert conditions transition an incident to a closed state only after the underlying signal remains within threshold for the full configured recovery period. When the recovery window is shorter than the natural variance cycle of the metric, incidents can repeatedly open and close, generating notification flapping that obscures genuine issues and fatigues on-call responders.
The behavior differs between static threshold conditions and baseline or anomaly detection conditions, and it also varies across APM, Infrastructure, Browser, and Synthetics signal sources. Aggregation method choices such as average versus maximum further influence whether a brief excursion is treated as a sustained breach or a momentary spike, which in turn affects how the recovery window is measured.
Account-level defaults for recovery duration may have changed in recent product updates, and data retention limits can prevent later verification of whether the signal truly satisfied the recovery criterion at the time of closure.
For a metric whose natural variance repeats every P minutes, the recovery window must be at least that period to stop flapping. The exact minimum differs by condition type:
P. If the window equals or exceeds the full oscillation cycle, the metric cannot cross the threshold again before the window elapses, so the incident stays closed.P × (1 + buffer), where a typical buffer is 20‑50 % (i.e., 1.2 P to 1.5 P). The extra time accommodates baseline drift and ensures the anomaly score stays within bounds for a stable period.Note: The aggregation method influences the needed window. Average aggregation smooths short spikes, often allowing a window close to P even for anomaly detection. Maximum aggregation preserves spikes, so you may need to add the buffer even for static thresholds.
GET /v2/alerts/incidents/{id}.SELECT average(value) FROM Metric
WHERE timestamp >= :open AND timestamp <= :close
TIMESERIES :recoveryWindow
evaluationWindow and closedReason fields from the Alerts API, which indicate whether New Relic’s internal logic deemed the recovery satisfied at close time.To give a precise window recommendation, confirm the aggregation method used in the condition (average, maximum, min, or percentiles). If you are using maximum aggregation, add the anomaly‑detection buffer even for static thresholds; otherwise the basic ≥ P rule suffices.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.