AWS Architect Certification Training
- 73k Enrolled Learners
- Live Class
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:
Cloud monitoring is a broad category that includes monitoring of web and cloud applications, infrastructure, networks, platform, application, and micro-services. Monitoring 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?
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:
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.
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 :
Before learning how Amazon CloudWatch operates there are certain primary concepts that you need to know. Let’s have a look at those concepts.
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.
You want AWS to send you an email notification whenever the alarm condition is satisfied. The notification is sent through Amazon SNS Topic.
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.
Now we will talk about the two most important segments of Amazon CloudWatch, which are :
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.
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 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.
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.
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.
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 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 Event is a record of some activity recorded by the application or resource being monitored|
|Log Streams||A 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 Groups||Log 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:
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.
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.