Search code examples
amazon-web-servicesamazon-dynamodbamazon-cloudwatchcloudwatch-alarms

Setting a CloudWatch alarm to check for DynamoDB items


I want to setup an alarm which would raise an alert in case there are any items in the DyanamoDB table. The alarm has been setup in the following manner -

enter image description here

My understanding is that -

  1. Period defines how regularly the data point is recorded in this case, a datapoint per minute.
  2. Maximum statistic means that we select the maximum value of RecordedItemCount in a minute.
  3. 2 out of 5 would mean that from the last 5 datapoint (5 minutes), if 2 of them are in ALARM, the state of the alarm would change.

However I am not seeing the intended results. I can only see a single datapoint (instead of a datapoint every minute?) in the chart and the state is OK even when the datapoint is above the threshold?

Could someone help out with this?


Solution

  • I figured out that this was the intended behaviour. As per the documentation for ReturnedItemCount -

    enter image description here

    This metric would only record a datapoint if the Query/Scan operation was performed on the table during a given time interval. It isn't a periodic check unlike some of the other metrics available on CloudWatch.