AWS Certified CloudOps Engineer – Associate
CloudWatch alarm evaluation and missing data for SOA-C03
The CloudWatch User Guide says an alarm is evaluated from three settings: Period, Evaluation Periods (N) and Datapoints to Alarm (M). It goes to ALARM when M of the last N data points breach, and they need not be consecutive. Missing points are handled as missing, notBreaching, breaching or ignore; the default is missing.
What are the three alarm states?
A metric alarm is always in one of three states. OK means the metric is within the threshold. ALARM means it is outside the threshold. INSUFFICIENT_DATA means the alarm has just started, the metric is not available, or there is not enough data to decide.
An alarm on a metric that nothing has published to yet sits in INSUFFICIENT_DATA. That is not a fault in the alarm. CloudWatch has nothing to compare with the threshold.
How does M out of N evaluation work?
Period is the length of time, in seconds, that makes one data point. Evaluation Periods is how many of the most recent data points CloudWatch looks at. Datapoints to Alarm is how many of those must breach before the alarm goes to ALARM.
When the two numbers differ you have an M out of N alarm. The breaching points do not have to be in a row; they only have to fall inside the last N points. With a 1-minute period, Evaluation Periods of 5 and Datapoints to Alarm of 3, any three breaching minutes in the last five trigger the alarm.
For a period of one minute or longer, the alarm is evaluated every minute over a sliding window. High-resolution alarms with a period of 10, 20 or 30 seconds are evaluated every 10 seconds and cost more. If N times the period is longer than one day, the alarm is evaluated once per hour.
How are missing data points treated?
Each alarm has one of four settings. notBreaching counts a missing point as within the threshold. breaching counts it as violating the threshold. ignore keeps the current alarm state. missing, the default, moves the alarm to INSUFFICIENT_DATA when every point in the evaluation range is missing.
AWS suggests breaching for a metric that reports continually, where silence may mean something is wrong, and notBreaching for a metric that only produces points when an error occurs.
Alarms on metrics in the AWS/DynamoDB namespace are an exception: they default to ignore, so when the data stops the alarm stays in whatever state it was in. You can override this with another setting.
CloudWatch retrieves more data points than Evaluation Periods asks for. If enough real points exist in that wider range, it uses them and the missing-data setting is not applied at all.
Where the exam catches people
- Believing the breaching data points must be consecutive: with M out of N they only have to fall within the last N data points.
- Believing
INSUFFICIENT_DATAon a new alarm means it is broken: it is the state for an alarm that has just started or a metric with no data. - Believing every alarm defaults to
missing: alarms onAWS/DynamoDBmetrics default toignoreand hold their current state when data stops. - Believing
ignoresends the alarm back toOK: it keeps the current state, so an alarm that was inALARMstays inALARM. - Mixing up the two settings: Evaluation Periods is the window (N); Datapoints to Alarm is the count that must breach (M).