Exploring CloudWatch metrics and Logs

In this section, we shall explore the CloudWatch metrics and logs generated by the ECS service and find log events for the CloudWatch alarm threshold being exceeded:

  • Open the CloudWatch console as shown here. The alarm summary for the AutoScaleCPUUtilization gets displayed in a graph.
  • Click on Browse Metrics to browse metrics:
  • Select Alarms in the margin. The AutoScaleBasedOnCPUUtilization alarm used as a threshold for auto scaling gets listed, as shown in the following screenshot. The alarm state is ALARM when the alarm threshold is exceeded.

The AutoScaleBasedOnCPUUtilization alarm details and graph get displayed. The two spikes in CPU utilization in the graph indicate that the alarm threshold has been exceeded, which applies the auto scaling to add one task each time the alarm threshold is exceeded. The first spike in the graph is for when the load is increased slightly, and the second spike is for when the load is increased to a greater extent:

  • When the load on the ECS service is reduced, the alarm state becomes OK. Reducing client load does not by itself reduce the number of running tasks. The scaling action used as an example only scales up the tasks if client load increases. Another scaling action would need to be added to scale down tasks on client load reduction. In the History tab, two instances of auto scaling action are listed, as shown in the following screenshot:
  • The Desired count of the service has been updated to 5, in addition to increasing the auto scaling running count to five tasks. The AutoScaleBasedOnCPUUtilization alarm may also be accessed from the auto scaling tab:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.151.45