Can I have a cloudwatch alarm when a custom metric isn't being produced?

261 Views Asked by At

I'm running a python process on an EC2 instance, and I want to alarm if it stops working properly. My plan was to have it add a custom metric data point every minute, and have a custom alarm if no data points are set for 5 minutes, say.

Is this possible? Is there another way to do what I want?

1

There are 1 best solutions below

2
On BEST ANSWER

You can do that, if you use SampleCount for the statistic, not Average or Sum. Then you can trigger an alert if the number of samples is less than a certain threshold.

(On a side note: Average or Sum would eventually go into Insufficient Data status rather than Alarm, if no samples are received at all.)