Cloud Watch

computethecloud
computethecloud
Published in
4 min readJan 19, 2019

Amazon CloudWatch is the component of Amazon Web Services that provides real-time monitoring of AWS resources and customer applications running on Amazon infrastructure.

The following image shows the different AWS resources monitored by Amazon CloudWatch.

Amazon CloudWatch allows administrators to easily monitor multiple instances and resources from one console by performing the below tasks :

  • Enables robust monitoring of resources like :
  1. Virtual instances hosted in Amazon EC2
  2. Databases located in Amazon RDS
  3. Data stored in Amazon S3
  4. Elastic Load Balancer
  5. Auto-Scaling Groups
  6. Other resources
  • Monitors, stores and provides access to system and application log files
  • Provides a catalog of standard reports that you can use to analyze trends and monitor system performance
  • Provides various alert capabilities, including rules and triggers high resolutions alarms and sends notifications
  • Collects and provides a real-time presentation of operational data in form of key metrics like CPU utilization, disk storage etc.

Amazon CloudWatch In Action

Before learning how Amazon CloudWatch operates there are certain primary concepts that you need to know. Let’s have a look at those concepts.

Metrics

  • Metrics represents a time-ordered set of data points that are published to CloudWatch
  • You can relate metric to a variable that is being monitored and data points to the value of that variable over time
  • Metrics are uniquely defined by a name, a namespace, and zero or more dimensions
  • Each data point has a time-stamp.

Dimensions

  • A dimension is a name/value pair that uniquely identifies a metric
  • Dimensions can be considered as categories of characteristics that describe a metric
  • Because dimensions are unique identifiers for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric.

Statistics

  • Statistics are metric data aggregations over specified periods of time
  • Aggregations are made using the namespace, metric name, dimensions within the time period you specify
  • Few available statistics are maximum, minimum, sum, average and sample count.

Alarm

  • An alarm can be used to automatically initiate actions on your behalf
  • It watches a single metric over a specified time period and performs one or more specified actions
  • The action is a simply a notification that is sent to Amazon SNS topic.

Now let’s have a look at how Amazon CloudWatch works. The following diagram shows the conceptual view of how CloudWatch provides robust monitoring.

Amazon CloudWatch has system-wide visibility into your AWS resources and applications. It will monitor your resource files and generate key metrics based on your application’s log files. Key metrics include CPU usage, CPU latency, Network traffic, Disk storage etc. Based on these metrics it provides a real-time summary of system activity and individual resources.

CloudWatch also provides a comprehensive at-a-glance view of AWS infrastructure to keep track of application performance, spot trends and troubleshoot operational issues. In addition, Amazon CloudWatch configures high-resolution alarms and sends real-time notifications in case of sudden operational changes in AWS environment.

Now that you are familiar with Amazon CloudWatch concepts and its operation let’s have a look at how you can use Amazon CloudWatch to monitor your Amazon EC2 instance.

Use Case: Configure Amazon CloudWatch to send a notification when CPU Utilization of an instance is lower than 15%.

Lets go through various steps involved.

Step 1 : Creating a CPU utilization metric

  • Go to Amazon CloudWatch Management Console and select metrics from the navigation pane.
  • On the metrics page type CPU Utilization in the search bar.
  • From the displayed list of instances choose the instance for which you want to create a metric.

Step 2 : Creating an alarm to notify when CPU Utilization metric of the instance is lower than 15%

  • Now select the Graphed Metrics option on the same page. Then set the time period according to your need. And choose an alarm icon located beside the selected instance.
  • Configure the alarm in the displayed dialog box. Give your alarm a name and description. Set the Threshold condition.

You want AWS to send you an email notification whenever the alarm condition is satisfied. The notification is sent through Amazon SNS Topic.

  • Select New List option if want to add new email recipient, or If you want to choose the existing one, choose Enter List and enter the name of SNS topic.
  • Click Create Alarm.

Congratulations, you have successfully configured Amazon CloudWatch Alarm to monitor your instance. You will receive the notification through an e-mail on the mail-id you have specified when the alarm condition is met.

--

--