AWS in 1 Min · Episode 154

Amazon CloudWatch alarms explained: states, actions and anomaly detection

Page people for real problems. Watch the one-minute video, then read the details.

David Gomez1:11 video · 3 min read

"An alarm is just a fixed threshold." Not anymore. A fixed line like "CPU above 80%" fires every busy Monday morning and stays silent at 3 a.m., when 40% CPU might be the real problem. Normal changes by the hour and by the day. Amazon CloudWatch alarms can follow that, and they can do more than send an email.

States and evaluation

A metric alarm watches one metric (or a math expression over metrics) and is always in one of three states:

  • OK: the value is within the threshold.
  • ALARM: the value has breached it.
  • INSUFFICIENT_DATA: not enough data to decide, for example a new alarm or a resource that stopped reporting.

An alarm does not fire on a single bad data point unless you tell it to. You set the period, the number of evaluation periods and the datapoints to alarm: for example, ALARM when 3 of the last 5 one-minute periods breach. One spike pages nobody; a sustained problem does. You also choose how missing data is treated, which matters for metrics that only report when something happens.

Actions

Alarms act when they change state. A metric alarm can:

  • send a notification to an Amazon SNS topic (email, SMS, chat, or a Lambda function subscribed to it),
  • run an EC2 Auto Scaling action to scale out or in,
  • stop, terminate, reboot or recover an EC2 instance,
  • start an investigation in CloudWatch investigations, or create a Systems Manager OpsItem or incident.

Fewer, better pages

Composite alarms combine other alarms with a rule such as "high errors AND high latency". You alert only on the composite, so the on-call engineer gets one page instead of twenty for the same incident. Composite alarms can notify and open investigations, but cannot run EC2 or Auto Scaling actions.

Since July 2026, CloudWatch also supports log alarms: you write a Logs Insights query, CloudWatch runs it on a schedule, and the alarm evaluates the results (M out of N runs) without you creating a metric filter first. There are also PromQL alarms for OpenTelemetry metrics.

A common mistake is alarming on everything. Start with symptoms users feel (errors, latency, failed jobs), give each alarm a clear owner, and add a runbook link in the alarm description.

Where AI fits

Anomaly detection replaces the fixed line with a learned one. CloudWatch applies machine learning to up to two weeks of a metric's history and models its trend and its hourly, daily and weekly patterns. The result is a band of expected values. An anomaly detection alarm goes to ALARM when the metric leaves that band (above, below, or either way), and the model keeps retraining as the metric changes. You can exclude deployments or past incidents from training.

It suits metrics that follow your users, such as request counts or the token usage of an AI feature, where "too high" at 3 a.m. is a very different number than at noon. Anomaly detection alarms are billed differently from standard alarms, so check pricing before enabling it everywhere.

Quick recap

  • Alarms have three states and act only on a state change.
  • Use M of N evaluation so a single spike doesn't page anyone.
  • Composite and log alarms cut noise and catch problems in logs.
  • Anomaly detection learns a metric's normal daily and weekly pattern.
AWS in 1 Min #154 · 1:11

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS