Certopolis

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_DATA on 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 on AWS/DynamoDB metrics default to ignore and hold their current state when data stops.
  • Believing ignore sends the alarm back to OK: it keeps the current state, so an alarm that was in ALARM stays in ALARM.
  • Mixing up the two settings: Evaluation Periods is the window (N); Datapoints to Alarm is the count that must breach (M).

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A SysOps administrator watches an API's 5XX error count with a CloudWatch alarm that uses a 1-minute period. Short bursts of errors are normal. The alarm must go to ALARM when any three of the last five minutes breach the threshold, even when those three minutes are not next to each other. Which solution will meet this requirement?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: B is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

  2. A SysOps administrator creates an Amazon CloudWatch alarm on a custom metric for a new order service. The service is not deployed yet, so nothing has ever published a data point to that metric. A few minutes after creating the alarm, the administrator opens it in the CloudWatch console. Which of the following describes the state that the console shows for the alarm?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: C is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The order service has never published a point, so CloudWatch has nothing to compare with the threshold and cannot call it either inside or outside.

    Written from docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-evaluation.html

  3. A SysOps administrator created a CloudWatch alarm with default settings on the WriteThrottleEvents metric of an Amazon DynamoDB table that a nightly import job loads. During last night's import, the alarm went to ALARM. The job was then cancelled, and the metric has received no data for two days. The alarm still shows ALARM. What is a reason for this issue?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: D is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    This alarm was in ALARM when the import stopped, so it stays there until data returns or the administrator picks another treatment.

    Written from docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarms-and-missing-data.html

Ask for something