CloudWatch anomaly detection

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)

Then you can create Clouwatch alarms based on that 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

--

--

This is my personal blog where I post (in my spare time) computer science “cheatsheets”. I mainly do it for myself but it may benefit others.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Greg

This is my personal blog where I post (in my spare time) computer science “cheatsheets”. I mainly do it for myself but it may benefit others.