AWS Builder Center

What a CloudWatch alarm costs and how it decides its state

Study notes on CloudWatch alarm pricing, the free allowance, how M out of N evaluation works, and how missing data changes the alarm state. Includes a small exercise inside the free tier.

Why this topic

Alarms look cheap, so they tend to be created and forgotten. These notes cover two things: how an alarm is billed, and how it decides between OK, ALARM and INSUFFICIENT_DATA. Pricing figures come from third-party summaries of the AWS price list, so check the official CloudWatch pricing page for your Region before relying on them.

What an alarm costs

Standard resolution alarms, which evaluate every 60 seconds, cost $0.10 per alarm per month in US East (N. Virginia). High-resolution alarms, which evaluate every 10 or 30 seconds, cost $0.30 per alarm per month. Composite alarms cost $0.50 each per month.
The billing unit is the metric, not the alarm. One source says AWS bills per metric, not per alarm, so an alarm monitoring four metrics costs $0.40 per month, not $0.10. Anomaly detection follows the same rule. A standard-resolution anomaly detection alarm costs 3 x $0.10 = $0.30 per month, because it uses the original metric plus the upper and lower bounds of the expected band.
The free allowance is small. The free tier includes 10 metrics, 10 alarms and 1 million API requests per month. Prices differ by Region, and I did not find a source for Mumbai (ap-south-1) prices. Check that page before assuming the US East figure applies.
A rough sense of scale: 50 forgotten standard alarms is $5.00 of unnecessary recurring spend every month. That is small, but it is an avoidable charge for a student account.

How an alarm decides its state

An alarm has three states: OK, ALARM and INSUFFICIENT_DATA. Two settings control the switch between them:
  • Period: the length of each data point.
  • Evaluation Periods (N): how many recent data points are examined.
  • Datapoints to Alarm (M): how many of those must breach the threshold.
The AWS documentation says that setting Evaluation Periods and Datapoints to Alarm to different values creates an "M out of N" alarm. Datapoints to Alarm is the number of data points within the evaluation periods that must be breaching to cause the alarm to go to the ALARM state.
A practical reading: with 3 out of 5, a single spike does not trigger the alarm, but three breaching points inside the last five do. With 1 out of 1, every spike triggers it. Choosing M and N is a trade-off between noisy alerts and slow detection.

Missing data

Many metrics, such as a Lambda function that is rarely invoked, have no data for long stretches. CloudWatch lets you choose how this is treated. The documentation lists the options:
  • breaching: missing data points are treated as "bad" and breaching the threshold.
  • ignore: the current alarm state is maintained.
  • missing: if all data points in the evaluation range are missing, the alarm goes to INSUFFICIENT_DATA.
Another AWS guide notes that if a metric is frequently missing data points by design, the alarm state is INSUFFICIENT_DATA during those periods. It suggests choosing to ignore missing data to keep the alarm from flapping between states. The default behaviour for a new alarm can vary by how it is created, so verify the setting in the console instead of assuming it.

Exercise: one alarm on a metric you already have

Estimated cost: $0.00 if you stay under 10 alarms in your account and use standard resolution. If you are past the free allowance, the figure above suggests about $0.10 per month for one standard alarm. Confirm on the pricing page.
  1. In the CloudWatch console, open Alarms and check how many alarms exist already. Stay under 10 in total.
  1. Create an alarm on a metric that already exists, for example the EstimatedCharges metric under Billing (which is published in us-east-1 and needs billing alerts enabled), or the Invocations metric of a Lambda function you own.
  1. Choose standard resolution (a 1 minute or longer period). Do not choose a 10 or 30 second period, since that is the high-resolution tier.
  1. Set Evaluation Periods to 3 and Datapoints to Alarm to 2.
  1. Set missing data handling to "treat missing data as ignore", then save a second note of what state the alarm shows after several minutes.
  1. A good follow-up is to edit the setting to "missing" and compare the resulting state. I would test this with a Lambda that is not being invoked, so the metric has no data.
  1. Optional: attach an SNS email notification. SNS has its own free allowance, which I did not verify here, so check its pricing page.
Cleanup: select the alarm in Alarms, choose Actions, then Delete. Delete the SNS topic and subscription if you made one. Check the Alarms list again so nothing stays behind.

Habits worth keeping

  • Count your alarms before adding new ones, because the free allowance is 10.
  • Remember that one alarm on several metrics bills for each metric.
  • Avoid high-resolution alarms unless you need that speed.
  • Decide missing data handling deliberately for each alarm.
  • Delete alarms when you delete the resource they watch.

Sources

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article