How does CloudWatch monitor EC2?

Cloud Connections

Amazon CloudWatch gathers and provides access to a treasure-trove of information about your AWS services, including, primarily EC2 instances. But its terms and terminologies can quickly get confusing.

Particularly, for users that are new.

No matter how you implement CloudWatch on your AWS infrastructure, if it is advanced enough, you will have to deal with the Amazon CloudWatch Logs solution to monitor, store and access log files from Amazon EC2 instances.

This can also be used to store your logs in Amazon S3 or Amazon Glacier, where you can retain them indefinitely, or set up an aging policy to delete older logs that are no longer needed. A CloudWatch Logs agent is also available that provides an automated way to send logo data to CloudWatch Logs.

Two ways to monitor Amazon EC2

CloudWatch makes it easy for users of Amazon EC2 and other services to create scalable and flexible monitoring routines without having to set up additional systems or tinkering with custom settings. Let’s take a look at the two ways Amazon allows you to monitor your EC2 instances.

The company offers Basic Monitoring and Detailed Monitoring.

Basic Monitoring

This gets you seven preselected metrics at five-minute frequency, and three status check metrics at one-minute frequency, with no additional charge. This is ideal for when you are starting out, and require an uncomplicated solution.

Detailed Monitoring

Advanced users, however will opt for this type of monitoring for their Amazon EC2 instances. You get all metrics available to Basic Monitoring at one-minute frequency. Additionally, instances that have this type of monitoring enabled will allow data aggregation by Amazon EC2 AMI ID and instance type.

With that out of the way, let’s go over at what makes up CloudWatch monitoring for EC2, its various parts, pieces, and puzzles.

The making of a cloud watch

Although it may sound simple, there are a lot of components that go into making CloudWatch one of the most versatile services on the Amazon Web Services cloud platform. These are the fine things that work together to provide you with detailed, up-to-the-minute actionable insights for your cloud.

Metrics

Metrics are essentially nothing more than values that Amazon CloudWatch monitors. But they form the core of the monitoring functionality of the service. They are reported as a value along with a timestamp. Each metric has data points associated with it that change over time. You can use them as they are reported, or create additional custom metrics as per your requirements. But do keep in mind that they are Region specific — a metric is only going to be available in the Region it was created.

Namespaces

Namespaces are defined as standard strings of characters that act as containers for your metrics and help keep them isolated form one another. You put them in in when you first create a metric, as no default namespace is provided. One namespace for each element that gets added to CloudWatch. Amazon provides the full list of AWS namespaces here.

Dimensions

Key-value pairs that help you in identifying your metrics. These come into play when you want to filter out certain results set that the CloudWatch query returns. Up to 10 dimensions can be assigned to a single metric.

Time stamps

These are simple date and time values that are usually provided in the UTC or GMT time zones. They are assigned to each data point in your metric.

Periods

The lengths of time associated with a particular statistic, the value between start and end times.

Units

Units are what help you get conceptual meaning of your metric data. Most of these are very similar to the regular units of measure, like count, bytes, bytes per second, percent, milliseconds.

Statistics

Metric data that has been aggregated over a period of time. CloudWatch provides five statistics, namely minimum, maximum, sum, average and sample count.

Alarms

An alarm is what watches over a particular metric for a stipulated period of time, and then performs some actions based on its trigger. These actions can be anything from sending a notification to triggering an auto scaling event. You can create and associate alarms to any AWS resource, provided they reside in the same Region.

Here we explore Cloudwatch costs in an additional article.