AWS Architect Certification Training (16 Blogs) Become a Certified Professional
AWS Global Infrastructure

Cloud Computing

Topics Covered
  • AWS Architect Certification Training (16 Blogs)
  • AWS Development (7 Blogs)
  • SFDC Administration Foundation (2 Blogs)
  • Salesforce Admin and Dev Foundation (8 Blogs)
SEE MORE

Amazon CloudWatch – A Monitoring Tool By Amazon

2.5K Views
author-avatar
Published on May 22,2019
1 / 2 Blog from AWS Services

Become a Certified Professional

Amazon CloudWatch Tutorial

Currently, more and more organizations are trying to digitally transform their business by migrating to cloud. This isn’t surprising but it does pose a challenge to the IT team who are responsible for the “effective” delivery of cloud services as well as the impact to the business if these services are impaired. So, how do they make sure that the services are not impaired? The simple answer is by employing a cloud monitoring tool: Amazon CloudWatch.

In this blog, we will be discussing one such versatile monitoring tool called Amazon CloudWatch. The topics which I will be covering in this blog are as follows:

  1. Why Do We Need Cloud-Based Monitoring?
  2. Introducing Amazon CloudWatch
  3. Amazon CloudWatch In Action
  4. What Are CloudWatch Events?
  5. What Are CloudWatch Logs?
  6. Benefits Of Amazon CloudWatch

Amazon CloudWatch Tutorial | Cloud Monitoring Tool | Edureka

Why Do We Need Cloud-Based Monitoring?

Cloud monitoring is a broad category that includes monitoring of web and cloud applications, infrastructure, networks, platform, application, and micro-servicesMonitoring is crucial to make sure that all the services which you are using on the cloud are running smoothly and efficiently.

Have a look at the image below. What are your thoughts regarding this image?

Cloudwatch-Edureka

The image depicts two scenarios.

Scenario 1: You have deployed a messenger application on cloud and you have a set of solutions. Questions are as follows:

  • How much bandwidth does my application use on a day to day basis?
  • How does my website’s traffic look like?
  • How is the performance of my app on the cloud?
  • Are customers satisfied with the current features of my app or do I have to make any improvements?

But you don’t have answers to any of the above questions since you are not using any kind of monitoring platform.  So you have no idea if your app needs any improvement. Because of which sales and revenue of your product have decreased rapidly.

Scenario 2: You have deployed an application on Cloud and you have the same set of questions again. You are using a  monitoring tool to keep a track of your application’s health.

So you know how well your application is performing on Cloud. You are now better-equipped to track down and address bottlenecks, improving your application’s uptime and performance. This in-turn encourages your users to engage more with your business!

A little bit of monitoring can go a long way to helping your business grow!

While it is still possible to build high-level tools to track and monitor the overall state of the AWS environment, but as the systems grow larger it becomes complex to carry out manual monitoring. So Amazon provides a versatile monitoring tool called Amazon CloudWatch that enables robust monitoring of AWS infrastructure for us. Now let us explore CloudWatch in detail.

Want To Take Your 'Cloud' Knowledge To Next Level?

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.

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

Amazon CloudWatch -Edureka

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. 

Now we know why users choose CloudWatch, which is, for its automatic integration with AWS services, its flexibility, and its ability to scale quickly. But how does Amazon CloudWatch achieve this?

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.

AWS-CloudWatch-Edureka

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.

CloudWatch-Metrics-Edureka

  • 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.

CloudWatch-Metrics-Edureka

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.

CloudWatch-Metrics-Edureka

  • 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.

CloudWatch-Alarm-Edureka

  • 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.

Want To Be A Certified AWS Architect?

Now we will talk about the two most important segments of Amazon CloudWatch, which are :

  • Amazon CloudWatch Events
  • Amazon CloudWatch Logs

Amazon CloudWatch Events

Amazon CloudWatch Events deliver a real-time stream of system events from AWS resources to AWS Lambda functions, Amazon SNS Topics, Amazon SQS queues, and other target types.

CloudWatch Events enable you to create a set of rules that you can match certain events with. Then you can route these events to one or more targets like Lambda Function, SNS Topic etc. Whenever there are operational changes in your AWS environment, CloudWatch Events capture these changes and perform remedial actions by sending notifications, activating Lambda functions etc.

Let’s talk about certain topics that you need to understand before using CloudWatch Events.

Events 

An event indicates a change in the AWS environment. AWS resources generate events when their state changes. Amazon allows you to generate your own custom application-level events and publish them to CloudWatch Events.

Rules

Rules are nothing but constraints. They evaluate every incoming event to determine if out-of-bounds scenario exists. If yes the event is then routed to target for processing. A single rule can route to multiple targets, all of which are processed in parallel.  

Targets

A target processes events. Targets can include Amazon EC2 instances, AWS Lambda functions, Kinesis streams, Amazon ECS tasks, Amazon SNS topics, Amazon SQS queues, and built-in targets. A target receives events in JSON format.   

Now let’s have a look at situations where we can use Amazon CloudWatch Events.

Use Case 1: You can log the changes in the state of an Amazon EC2 instance by using CloudWatch Events with the assistance of AWS Lambda function.

UseCase1-Edureka

Use Case 2: You can log the object-level API operations on your S3 buckets using CloudWatch Events. But prior to that, you should use AWS CloudTrail to set up a trail configured to receive these operations.                                        

CloudWatch-Events-Edureka

Well, these are just two use-cases which I have specified here so that you will have an idea about the capability of Amazon CloudWatch Events. To describe Amazon CloudWatch Events in one sentence, it is a service that allows you to track changes to your AWS resources with less overhead and more efficiency.

Amazon CloudWatch Logs

Amazon CloudWatch Logs is used to monitor, store and access log files from AWS resources like Amazon EC2 instances, Amazon CloudTrail, Route53, and others.

Let’s take a look at a few basic concepts of Amazon CloudWatch Logs. The below table gives an overview of those concepts.

  Log Events

Log Event is a record of some activity recorded by the application or resource being monitored
  Log StreamsA log stream is a sequence of log events that share the same source. It represents the sequence of events coming from the application instance
  Log GroupsLog groups represent groups of log streams that share the same retention, monitoring, and access control settings. Each log stream has to belong to one log group.

 

With Amazon CloudWatch Logs you can troubleshoot your system errors and maintain and store the respective log files automatically. You can configure an alarm so that a notification will be sent when some error occurs in your system log. You can then troubleshoot the errors within minutes by accessing the original log data stored by CloudWatch Logs. Moreover, you can use Amazon CloudWatch Logs to:

  • Store your log data in the highly durable storage
  • Monitor your application log files in real-time for specific phrases, values or patterns
  • Log information about the DNS queries that Route 53 receives
  • Adjust the retention policy for each log group, by choosing a retention period between 10 years and one day.

Now that we have a foundation of Amazon CloudWatch lets go ahead and look at few reasons as to why it is the most famous cloud monitoring tool.

Benefits of Amazon CloudWatch

  • Amazon CloudWatch allows you to access all your data from a single platform. It is natively integrated with more than 70 AWS services. Vodafone company uses Amazon CloudWatch with Auto Scaling groups to monitor CPU usage and to scale from three Amazon EC2 instances to nine during peak periods automatically.
  • Provides real-time insights so that you can optimize operational costs and AWS resources. Kellogg company uses Amazon CloudWatch for monitoring, which helps the company make better decisions around the capacity they need, so that they can avoid wastage.
  • Provides complete visibility across your applications, infrastructure stack, and AWS services. Atlassian uses Amazon CloudWatch to monitor RAM usage and bandwidth, so they can more easily optimize their application.

These are just a few benefits of using CloudWatch. 

So this is it! I hope this blog was informative and added value to your knowledge. Now you what Amazon CloudWatch is and how you can employ it to monitor your applications and resources that are currently active on the cloud. If you are interested to take your knowledge on Amazon Web Services to the next level then enroll for the AWS Architect Certification Training course by Edureka.

Got a question for us? Please mention it “AWS CloudWatch Tutorial” blog and we will get back to you.

Comments
0 Comments

Browse Categories

Subscribe to our Newsletter, and get personalized recommendations.