top
upGrad KnowledgeHut SkillFest Sale!

Search

AWS Tutorials

CloudWatch Monitoring is a service offered by Amazon that helps monitor the AWS resources and the user applications which run on AWS in real-time. It can also be used to gather and keep a track on the metrics, where metrics refers to variables which can be measured for the resources and applications that the user uses.  CloudWatch page automatically displays the metrics with respect to every AWS service which the user is associated with. Users are also able to create customized dashboards that help display metrics about specific applications. They can also be used to display a customized collection of metrics which are chosen by the user.  Alarms can be created by the user that help in monitoring the metrics and sending notifications regarding the state of the metrics. These alarms can also be used to automatically make certain changes to the AWS resources which are being monitored by the user when a certain condition is met or a threshold is reached.  An example would be monitoring the usage of CPU and disk reads and writes of the Amazon EC2 instance.This data can be used to understand whether additional instances need to be launched to handle the increase in load.  The same data can also be used to stop instances which are not being used, and thereby helps in saving costs.  CloudWatch helps provide system-wide visibility into the utilization of resources, how the application performs and the health of the operations which take place in the system.Access to CloudWatchCloudWatch can be accessed in the below mentioned ways:Amazon CloudWatch console AWS CLI (Command Line Interface) CloudWatch API AWS SDK Services which can be used with Amazon CloudWatch: Amazon Simple Notification Service (SNS)It is used to coordinate and manage the delivery of sending messages to subscribing endpoints or the clients. This service can be integrated with CloudWatch to send messages to the user when an alarm threshold is reached or a condition is met.  Amazon EC2 auto-scalingAuto-scaling helps the user to automatically launch or remove an EC2 instance which is based on certain policies that are defined by the user beforehand, or based on health status of the instance, and schedules. CloudWatch can be integrated with Amazon EC2 to scale the EC2 instance based on the requirements.   CloudTrailIt can be used to monitor calls that are made to Amazon CloudWatch API for that specific user’s account. These calls include the ones made by AWS Management Console, AWS CLI and other AWS services. When the CloudTrail logging is enabled, CloudWatch can be used to write the log file to an Amazon S3 bucket which is specified by the user when CloudTrail is configured.  AWS IAM (Identity and Access Management)IAM is a web service which helps in securely controlling access to AWS resources of the users. IAM can be used to control which users use the account holder’s AWS resources (known as authentication) and which resources could be used in which ways (known as authorization).  Working of CloudWatchIt can be understood as a repository which is used to store and monitor the metrics. An Amazon service like EC2 can be used to store these metrics into a repository, retrieve the insights based on these metrics and take certain actions (if configured to do so). The same can be done on customized metrics as well.  This data can be used to extract insights, calculate statistics, and present this data visually in the CloudWatch console.  Below is an image that shows how CloudWatch works:CloudWatch doesn’t aggregate any data based on ‘regions’. Hence these metrics are separated between these regions. Region refers to a specific geographical area, wherein a data center is facilitated so that data is highly-available, scalable, and stable and can help achieve maximum failure isolation. Failure isolation is maximized so that when a single component fails, other components don’t break down too. CloudWatch homepageThe below image shows the CloudWatch overview homepage. The components on this page have been discussed below:The upper left portion of the image lists the AWS services which are present in that user account. It also shows the state of alarms present within every Amazon service.  The upper right part also shows two or four alarms in the user account, and this number depends on the number of services which the user uses. These are the alarms which are currently in the ALARM state or ones which have changed their state in the recent times.  The upper area of the image allows the user to access the health state of the AWS services. This is done by observing the state of the alarm of every service and noting which alarm has recently changed its state.  This way, alarms can be monitored easily and issues can be diagnosed quickly.  Just below this is the ‘default dashboard’, if it exists. It is a custom dashboard that is generated by the user, and is named as ‘CloudWatch-Default’.  This is the simplest way to add customized metrics to the overview page about customized services/applications. This default dashboard can also be used to bring forth the additional key metrics from other AWS services which need to be monitored by the user.  If the user uses less than 6 Amazon services, another dashboard known as cross-service dashboard is shown automatically on the same page.  If the user is using more than 6 Amazon services, there is a part below the default dashboard which is a link to the automatic cross-service dashboard. This dashboard helps in automatically displaying key metrics from every Amazon service which the user uses. This doesn’t require the user to choose which metrics need to be monitored (thereby avoiding the creation of another customized dashboard) This overview helps the user to focus on a specific resource group or an Amazon service. This way, the view of monitoring the services can be narrowed down to a subset of all the resources. Usage of resource groups helps the user to use tags to organize the projects and focus on specific subsets of this architecture (or even distinguishing between development and production environments), hence improving the efficiency and saving user’s time.  ConclusionIn this post, we understood how CloudWatch works, and how it can be integrated with other Amazon services.
logo

AWS Tutorials

How does CloudWatch works?

CloudWatch Monitoring is a service offered by Amazon that helps monitor the AWS resources and the user applications which run on AWS in real-time. It can also be used to gather and keep a track on the metrics, where metrics refers to variables which can be measured for the resources and applications that the user uses.  

CloudWatch page automatically displays the metrics with respect to every AWS service which the user is associated with. Users are also able to create customized dashboards that help display metrics about specific applications. They can also be used to display a customized collection of metrics which are chosen by the user.  

Alarms can be created by the user that help in monitoring the metrics and sending notifications regarding the state of the metrics. These alarms can also be used to automatically make certain changes to the AWS resources which are being monitored by the user when a certain condition is met or a threshold is reached.  

An example would be monitoring the usage of CPU and disk reads and writes of the Amazon EC2 instance.

  • This data can be used to understand whether additional instances need to be launched to handle the increase in load.  
  • The same data can also be used to stop instances which are not being used, and thereby helps in saving costs.  

CloudWatch helps provide system-wide visibility into the utilization of resources, how the application performs and the health of the operations which take place in the system.

Access to CloudWatch

CloudWatch can be accessed in the below mentioned ways:

  • Amazon CloudWatch console 
  • AWS CLI (Command Line Interface) 
  • CloudWatch API 
  • AWS SDK 

Services which can be used with Amazon CloudWatch: 

Amazon Simple Notification Service (SNS)

It is used to coordinate and manage the delivery of sending messages to subscribing endpoints or the clients. This service can be integrated with CloudWatch to send messages to the user when an alarm threshold is reached or a condition is met.  

Amazon EC2 auto-scaling

Auto-scaling helps the user to automatically launch or remove an EC2 instance which is based on certain policies that are defined by the user beforehand, or based on health status of the instance, and schedules. CloudWatch can be integrated with Amazon EC2 to scale the EC2 instance based on the requirements.   

CloudTrail

It can be used to monitor calls that are made to Amazon CloudWatch API for that specific user’s account. These calls include the ones made by AWS Management Console, AWS CLI and other AWS services. When the CloudTrail logging is enabled, CloudWatch can be used to write the log file to an Amazon S3 bucket which is specified by the user when CloudTrail is configured.  

AWS IAM (Identity and Access Management)

IAM is a web service which helps in securely controlling access to AWS resources of the users. IAM can be used to control which users use the account holder’s AWS resources (known as authentication) and which resources could be used in which ways (known as authorization).  

Working of CloudWatch

It can be understood as a repository which is used to store and monitor the metrics. An Amazon service like EC2 can be used to store these metrics into a repository, retrieve the insights based on these metrics and take certain actions (if configured to do so). The same can be done on customized metrics as well.  

This data can be used to extract insights, calculate statistics, and present this data visually in the CloudWatch console.  

Below is an image that shows how CloudWatch works:

AWS CloudWatch Monitoring

CloudWatch doesn’t aggregate any data based on ‘regions’. Hence these metrics are separated between these regions. Region refers to a specific geographical area, wherein a data center is facilitated so that data is highly-available, scalable, and stable and can help achieve maximum failure isolation. Failure isolation is maximized so that when a single component fails, other components don’t break down too. 

CloudWatch homepage

The below image shows the CloudWatch overview homepage. The components on this page have been discussed below:

AWS CloudWatch Monitoring

The upper left portion of the image lists the AWS services which are present in that user account. It also shows the state of alarms present within every Amazon service.  

The upper right part also shows two or four alarms in the user account, and this number depends on the number of services which the user uses. These are the alarms which are currently in the ALARM state or ones which have changed their state in the recent times.  

The upper area of the image allows the user to access the health state of the AWS services. This is done by observing the state of the alarm of every service and noting which alarm has recently changed its state.  

This way, alarms can be monitored easily and issues can be diagnosed quickly.  Just below this is the ‘default dashboard’, if it exists. It is a custom dashboard that is generated by the user, and is named as ‘CloudWatch-Default’.  

This is the simplest way to add customized metrics to the overview page about customized services/applications. This default dashboard can also be used to bring forth the additional key metrics from other AWS services which need to be monitored by the user.  

If the user uses less than 6 Amazon services, another dashboard known as cross-service dashboard is shown automatically on the same page.  

If the user is using more than 6 Amazon services, there is a part below the default dashboard which is a link to the automatic cross-service dashboard. This dashboard helps in automatically displaying key metrics from every Amazon service which the user uses. This doesn’t require the user to choose which metrics need to be monitored (thereby avoiding the creation of another customized dashboard) 

This overview helps the user to focus on a specific resource group or an Amazon service. This way, the view of monitoring the services can be narrowed down to a subset of all the resources. Usage of resource groups helps the user to use tags to organize the projects and focus on specific subsets of this architecture (or even distinguishing between development and production environments), hence improving the efficiency and saving user’s time.  

Conclusion

In this post, we understood how CloudWatch works, and how it can be integrated with other Amazon services.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments

tenzin nyima

Whoever has contributed to this article...I would like to say thank you... it has been of good help to the readers.

alvi

This blog is very helpful and informative, and I really learned a lot from it.

alvi

It is very helpful and very informative, and I really learned a lot from this article.

alvi

Such a very useful article. I would like to thank you for the efforts you made in writing this awesome blog.

Jeanne

Very useful and awesome blog!