Skip to content

Reduce AttributeEventAlarm flapping after event rate changes - #3655

Merged
denniskuijs merged 2 commits into
mainfrom
enhancement/cloudwatch-alarms
Dec 2, 2026
Merged

denniskuijs merged 2 commits into
mainfrom
enhancement/cloudwatch-alarms

Conversation

@richturner

Copy link
Copy Markdown
Member

Description

AttributeEventAlarm raised many alarms after a step change in the attribute event rate (e.g. a batch of devices being added). The anomaly detector trains on up to two weeks of history, so after a jump the rate stays outside the band until the model adapts. When the band edge then reaches the new level, the rate sits on the edge and the alarm flaps between ALARM and OK, which sends an email both ways.

Changes to the alarm, keeping both the upper and lower thresholds:

  • Band widened from 3 to 4 standard deviations
  • Period increased from 5 to 15 minutes, which smooths the 100s Prometheus scrape deltas
  • Alarms on 3 of the last 4 periods (was 2 of 3), so a deviation must last ~45 minutes

A lasting step change still alarms until the model has adapted. To retrain sooner after a known change, exclude the time before the step from the detector's training with put-anomaly-detector --configuration ExcludedTimeRanges=... (a comment in the template notes this).

Instances pick this up on their next stack update.

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

Widen the anomaly detection band to 4 standard deviations and evaluate
15-minute periods, alarming on 3 of the last 4, so short bursts and a rate
sitting near the band edge no longer flap the alarm. Both the upper and
lower thresholds are kept.
@richturner richturner added the Enhancement Improvement of an existing feature label Dec 2, 2026
@richturner richturner self-assigned this Dec 2, 2026
@richturner
richturner requested a review from a team December 2, 2026 11:48
@denniskuijs
denniskuijs added this pull request to the merge queue Dec 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

@denniskuijs
denniskuijs added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 6e05016 Dec 2, 2026
21 checks passed
@denniskuijs
denniskuijs deleted the enhancement/cloudwatch-alarms branch December 2, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants