Amazon CloudWatch (Part 1)

Kasun Dissanayake
6 min readJun 6, 2020

In this tutorial, I am going to explain about Amazin CloudWatch and its features step by step. Here are the main topics that I am going to explain.

  • What Amazon CloudWatch is and Why do we need it?
  • Amazon CloudWatch concepts.

First of all, let’s figure out Why we need Cloud-Based Monitoring?

  • Performance

Think about the Facebook application. You know that With over 2.6 billion monthly active users as of the first quarter of 2020, Facebook is the biggest social network worldwide. In the third quarter of 2012, the number of active Facebook users surpassed one billion, making it the first social network ever to do so. Here you can see the number of people using the application growing fast. And you have no idea what the issues happen on. Well, I could be due to 2 reasons.

  • Your application can have complex functions and monitoring each function is very hard to do.
  • You have no idea about your application performing in the Cloud since you have no monitoring tool.

Well, One solution to that performing a Monitoring Tool. This Monitoring tool provides you to monitor how your application performs. And also you can make some necessary improvements to your application using this monitoring tool.

Provide a catalog of standard reports that you can use to analyze trends and monitor the system performance.

  • Cost

Assume your manager assigned you some project and he is watching you make this project cost-effective as possible. Here you can see you are using 5 Virtual Servers which performs highly complex computations. And all these servers are highly active during Day-time. But in the Night-time they are not active, they are idle. Let’s assume CPU Utilization of these servers is less than 50%. And you can observe you are paying some money for both Day and Night. Here you need to consider two points.

  • All your servers are underuse in the night time
  • You are paying for the resources which you are not using.

So this is not cost-effective. So that you just need to add monitoring too. Using a monitoring tool you can get notifications when your servers go to Idle. And you can schedule te servers.

To reduce unnecessary operating costs by sending notification in case of unreasonable pricing issues

  • Detecting Errors and Troubleshooting

Let’s say I have hosted an e-commerce website on Cloud. Many customers are trying to access my website which is definitely a good thing. But unfortunately for some reason application downtime is up. Since I am not using a Monitoring tool it is very hard to identify the error and troubleshoot it. Because of the downtime period, my customers might have moved to another website. So you can see here I have lost my potential customers. If I have a monitoring tool it easily identifies the errors and troubleshoots. It will increase my customer count.

Detect problems early to prevent disasters. Also prevent and reduce downtime and business losses.

What is Amazon CloudWatch?

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

Amazon CloudWatch is a powerful tool and most reliable, scalable, and flexible way to monitor your resources for any application which is currently active on Cloud.

It usually offers you two levels of monitoring. They are Basic Monitoring and Detailed Monitoring.

Basic Monitoring

Here your resources are monitored less frequently. Like, say within 5 minutes. And there are very few metrics.

Detailed Monitoring

Here your resources are monitored every 1 minute. And there is a wide range of metrics.

If you want to make your resources to Detailed Monitoring you have to pay some money according to pricing details.

What does Amazon CloudWatch Do?

Let’s look at a few monitoring services offered by CloudWatch.

  • Collects and tracks key metrics.
  • Collects monitor and stotes log files.
  • Creates high-resolution alarms and send notifications.
  • Send system events from AWS resources to AWS lambda, SNS, etc.

Amazon CloudWatch allows Administrators to monitor multiple resources and applications from a single control. These resources include,

  • Virtual Instances (EC2)
  • Databases (AWS RDS)
  • Data Stored in Amazon S3
  • Elastic Load Balancers
  • Other AWS Resources

Amazon CloudWatch Concepts

Let’s talk about a few Amazon CloudWatch concepts. Then we can talk about How Amazon CloudWatch operates.

  • Metrics — A metric represents a time-ordered set of data points that are published to CloudWatch. Think of a metric as a variable to monitor, and the data points represent the values of that variable over time. (Suppose you have 3 variables like x, y, and z. You have created a table that has value x with respect to y over the period of time. In this scenario, the variable x which has been monitoring still now is a matrix. So it is think of a matrix as a variable which needs monitoring)
  • Dimensions — A dimension is a name/value pair that uniquely identifies a metric. They can be considered as categories of characteristics that describe a metric. We can assign up to 10 dimensions to a metric. (Previously we have created a table with x respect to y. Now let’s create another table which has the same x respect to z. So basically we have two tables which describe same variable x but from two different perspectives. These are nothing but dimensions. So basically dimensions are name-value pairs to identify a 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. (Previously we have created 2 tables. You can combine data from these tables to create a chart or graph for analytical purposes. This combination of data is nothing but statistics)
  • 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. (Let’s say you have been monitoring variable x for some time now. And you need to send a notification when this variable x reaches to certain threshold. All you have to send an alarm)

How Amazon CloudWatch Works?

Amazon CloudWatch has complete visibility into your AWS resources and applications which you are running on Cloud. It collects Metrics and logs on all these AWS resources and applications. Using these metrics it helps to visualize on CloudWatch Dashboard. Moreover, it makes operations changes to the AWS environment and takes some actions like sending notifications, activating Lambda functions and etc. Finally, it provides realtime analysis using Cloudwatch metrics.

Here there is a service which is having multiple CloudWatch series and creates time series. You can use this time series in CloudWatc Dashboard as well. So that you can Monitor your Application. Amazon CloudWatch provides you System-wide visibility. It even provides you actionable size so that you can monitor your application performance. Also, you can optimize AWS resources. And finally, it provides a unified view of the operational health of your AWS environment.

I hope you will get a basic understanding about CloudWatch. In the next tutorial, we will discuss Amazon CloudWatch Events, Charts, and Amazon CloudWatch Logs.

Thank You!

--

--

Kasun Dissanayake

Senior Software Engineer at IFS R & D International || Former Software Engineer at Pearson Lanka || Former Associate Software Engineer at hSenid Mobile