A metric alarm watches a single CloudWatch metric or the result of a math expression based on CloudWatch metrics. The alarm performs one or more actions based on the value of the metric or expression relative to a threshold over a number of time periods. The action can be an Amazon EC2 action, an Amazon EC2 Auto Scaling action, or a notification sent to an Amazon SNS topic.
This will take you to the Metrics home page, where you will see all the Namespaces available in the account.
Inside the Namespace, you will see all the dimensions under which the metrics are aggregated under.
6. Select the
ClusterName dimension and select one of the
CPU Utilization metrics.
If you see
pod_cpu_utilization, select that one.
Your screen should look similar to the one below.
Select metricin the bottom right corner.
This will take you to the screen as the one below.
Enter the threshold value (for example, 50 which means 50% CPU utlization because this metric is a percent type) that you want the metric data to be monitored. (Notice that
Static option is selected by default, which means we will be setting a static value as the threshold to be monitored.)
Additional configuration where you can indicate how many occurences of the breach qualifies for the alarm to be triggered.
Set the values to 2 out of 5.
This will make the alarm get triggered if there has been 2 breaches in 5 evaluation periods. Notice the message at the top of the graph describing the setting as
This alarm will trigger when the blue line goes above the red line for 2 datapoints within 25 minutes.
Configure actions screen, you can set what action you want to take when the alarm changes to different states such as
The available options for actions include
Create a new topicto create a new SNS topic to send the notification to and provide your email address.
Create topicto create the SNS topic.
Next, then give the alarm a name and click
Nextagain to review the configuration.
Createto create the alarm.
Once you have created the alarm, you will notice that the alarm is now in
Insufficient data state which indicates that there is not enough data to validate the alarm. Waiting for 5 minutes will change the alarm state to
OK in green.
Notice the alarm state now changed to ‘OK’ after evaluation was complete.
This concludes this section. You may continue on to the next section.