CloudWatch is a monitoring service that connects with almost all the services on the AWS platform. It’s a very important topic for the SOA-CO2 exam. AWS pushes some default monitoring metrics from EC2 instances onto CloudWatch.

EC2 monitoring types

EC2s support two types of CloudWatch monitoring.

  • Basic monitoring: Free monitoring from AWS where metrics are collected at five-minute intervals.
  • Detailed monitoring: Paid monitoring where metrics are collected at one-minute intervals.

Note: Both monitoring types gather exactly the same metrics from the EC2 instances and differ only in the metric collection frequency.

Default and custom metrics

EC2 instances push CPU, network, disk (for instances with store volumes), and status check metrics by default to CloudWatch.

  • CPU metrics: CPU utilization metrics for all instances and credit usage and balance metrics for burstable (T) instances.
  • Network: Network in and out (bytes/packets) metrics for all instance types.
  • Disk: Read-and-write (ops/bytes) metrics for instance types that have instance stores.
  • Status check: Instance and system status metrics for all instance types.

We can also push our own custom metrics to CloudWatch. These metrics have a basic resolution of one minute and also support a resolution of up to one second. We can push RAM or other application metrics as custom metrics by using the CloudWatch agent and giving appropriate permissions to EC2.

Note: RAM isn’t a default metric. If required, it can be pushed to CloudWatch as a custom metric.

CloudWatch metrics in the EC2 console

Follow the steps below to view CloudWatch metrics for an EC2 instance.

  1. Go to the EC2 console and click one of the instances.
  2. Head over to the “Monitoring” tab to see the default CloudWatch metrics for this instance.

On this tab, we can see that we’re currently using basic monitoring for our EC2 instance. We can quickly change this by clicking the “Manage detailed monitoring” button on the right. We can add metrics of an instance to a CloudWatch dashboard directly by clicking on the “Add to dashboard” button. We’ll need to create a CloudWatch dashboard if one doesn’t already exist.

Note: We may not be able to find EC2 namespace or metric data in our CloudWatch service dashboard if we’ve been terminating the provisioned EC2 instances.

Get hands-on with 1200+ tech skills courses.