I think you'll want to configure Amazon CloudWatch to treat a lack of data differently. In short, you can specify CloudWatch to treat missing data points as any of the following:
- notBreaching – Missing data points are treated as "good" and within the threshold
- 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 alarm evaluation range are missing, the alarm transitions to INSUFFICIENT_DATA.
The default option is missing, so I think this is why you are seeing the alarm back to OK. You might consider ignore or notBreaching depending on the behavior you are looking for.
You can find more information here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data
Hi, your question makes me wonder why your alarms transition from Insufficient state to OK - is it a one-off event only happening at alarm creation time, or is it a recurring behavior, in which case is it because your resources are transient and you turn them off making them stop emitting the metric, or is there another reason for your alarms to switch to the insufficient state? If it's a one-off event at alarm creation time, how impactful is it to your workflow? is it something that can be neglected? If it's recurring, you could work around it by using Paul's suggestion in the previous answer or apply metric math to your metric to fill missing datapoints with a 0 value, which would prevent your alarm from flipping to the insufficient state?
Sending Amazon CloudWatch alerts to existing monitoring tools via AWS Direct ConnectAccepted Answerasked 2 years ago
AWS CloudWatch Custom Widget With lambdaasked 9 days ago
CloudWatch : Repeating Alerts on Insufficient State ChangeAccepted Answerasked a month ago
How to setup email alerts to my cloudwatch alarmsasked 9 months ago
Memory metric showing in insufficient state after creation of memory metricasked 3 years ago
Why am I not able to create alerts and set alert thresholds?asked 2 months ago
CloudWatch alarms creating automaticallyasked 4 months ago
Cloudwatch Agent with nvme disks and setting up alertsAccepted Answerasked 3 years ago
Cloudwatch alarms with Airflow MWAAasked 8 months ago
CloudWatch stopping tail when file is deletedasked 2 years ago