CloudWatch anomaly detection

Greg
Jan 31, 2023

--

First step, let’s create an anomaly detector model on a specific CloudWatch metric (EC2 Average CPUUtilization for an instance):

aws cloudwatch put-anomaly-detector — namespace “AWS/EC2” — metric-name “CPUUtilization” — dimensions Name=InstanceId,Value=i-0345489963224c1a3 — stat “Average”

We can list our Cloudwatch anomaly detectors for the CPUUtilization of all our EC2 instances with

aws cloudwatch describe-anomaly-detectors — metric-name “CPUUtilization” — namespace “AWS/EC2”

In the AWS Console, you will be able to see the different models you have created:

You can change the sensitivity of the model if you want (bigger numbers means less sensitive)

Making the model less sensitive with the value 8 (greater than previous value 2)

Then you can create Clouwatch alarms based on that anomaly detection

Creating a CW alarm using the anomaly detection

When no longer needed, we can delete the Anomaly detector model we have created

aws cloudwatch delete-anomaly-detector — metric-name “CPUUtilization” — namespace “AWS/EC2” — dimensions Name=InstanceId,Value=i-0345489963224c1a3 — stat Average

--

--

Greg
Greg

No responses yet