Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
  • SQL
  • Web Development
  • System Design
  • Aptitude
  • GfG Premium
Open In App
Next Article:
AWS CloudTrail
Next article icon

Introduction to Amazon CloudWatch

Last Updated : 17 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Amazon CloudWatch is a service used for monitoring and observing resources in real-time, built for DevOps engineers, developers, site reliability engineers (SREs), and IT managers. CloudWatch provides users with data and actionable insights to monitor their respective applications, stimulate system-wide performance changes, and optimize resource utilization. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing its users with an aggregated view of AWS resources, applications, and services that run on AWS. The CloudWatch can also be used to detect anomalous behavior in the environments, set warnings and alarms, visualize logs and metrics side by side, take automated actions, and troubleshoot issues.

Amazon CloudWatch Agent

Amazon CloudWatch is an open-source lightweight tool that is used to collect the data of the resources in which they are deployed. Some of the data is as follows

  • Metrics: Amazon CloudWatch agent will record the data of CPU utilization, memory usage, disk i/o other system-level stats.
  • Logs: It will collect all the logs which are used for the further analysis
  • Events: Launching of significant instances, modifications to security groups, and other events.

What is Amazon CloudWatch?

Amazon CloudWatch is a monitoring and observability service provided by Amazon Web Services (AWS) that enables users to collect and track metrics, monitor log files, set alarms, and automatically react to changes in AWS resources. It helps users gain insights into the operational health, performance, and resource utilization of their AWS infrastructure and applications.

Why Amazon CloudWatch?

Amazon Cloud Watch is a monitoring service offered by Amazon Web Services to monitor applications like the following.

  • Performance.
  • Health of the application.
  • Monitors the resource use, etc.

You can set the alarm to the to the resource use of the applications when the limits are exceeded then you will get the notification to the mail automatically.

How Amazon CloudWatch Works

At first Amazon Cloud watch will configured to the resource that you want to monitor from there the agents that are configured will be used to collect the logs from the resources the service may be run on-premises or AWS. CloudWatch also provides the overall view of the resources with the help of a dashboard from where you can troubleshoot the issues. CloudWatch also performs the operational changes depending on the changes made to the resources they will also perform the AWS auto-scaling of the resources depending on the changes that occurred. CloudWatch performs real-time analysis based on the logs that have been received.

Amazon CloudWatch Features

Metrics

  • It represents a time-ordered set of data points that are published to Amazon CloudWatch.
  • All data point is marked with a timestamp.
  • Metric is a variable that is monitored and data points are the value of that variable over time.
  • They are uniquely defined by a name, namespace, and zero or more dimensions.
  • Metric math is used to query multiple CloudWatch metrics and use math expressions to create new time series based on these metrics

Dimensions

  • A dimension is a name/value pair which uniquely identifies a metric.
  • Dimensions are the unique identifiers for a metric, so whenever you add a unique name/value pair to one of the metrics, you are creating a new variation of that metric.

Statistics

  • Statistics are metric data aggregations over specified periods of time.
  • The few available statistics on CloudWatch are maximum, minimum, sum, average, and sample count.

Alarm

  • It is used  to automatically initiate actions on our behalf.
  • It watches a single metric over a specified time period and performs one or more specified actions based on the value of the metric.
  • The estimated AWS charges can also be monitored using the alarm.

Percentiles

  • It represents the relative weightage of the data in a dataset.
  • It helps the user to get a better understanding of the distribution of metric data.

CloudWatch dashboard

  • A user-friendly CloudWatch console is available which is used for monitoring resources in a single view.
  • There is no limit on the number of CloudWatch dashboards you can create.
  • These dashboards are global and not region-specific.

CloudWatch agent

  • It is required to be installed.
  • It collects logs and system-level metrics from EC2 instances and on-premises servers.

CloudWatch Events

  • CloudWatch events help you to create a set of rules that match with any event(i.e. stopping of EC2 instance).
  • These events can be routed to one or more targets like AWS Lambda functions, Amazon SNS Topics, Amazon SQS queues, and other target types.
  • CloudWatch Events observes the operational events continuously and whenever there is any change in the state of the event, it performs the action by sending notifications, activating lambda, etc.
  • An event indicates a change in the AWS environment. Whenever there is a change in the state of AWS resources, events are generated.
  • Rules are used for matching events and routing to targets.
  • Target process events. They include Amazon EC2 instances, AWS Lambda functions, etc. A target receives the events in JSON format.

CloudWatch logs

  • Amazon CloudWatch logs enable you to store, monitor, and access files from AWS resources like Amazon EC2 instances, Route53, etc.
  • It also helps you to troubleshoot your system errors and maintain the logs in highly durable storage.
  • It also creates log of information about the DNS queries that Route 53 receives.

Getting started with Amazon CloudWatch

Notifying gfg website management team when the instance on which gfg website is hosted stops Whenever the CPU utilization of instance (on which GeeksForGeeks website is hosted ) goes above 80%, CloudWatch event is triggered. This CloudWatch event then activates the SNS topic which sends the alert email to the attached gfg subscribers.

Create an SNS Topic

Step 1: Let us assume that you have already launched an instance with the name tag 'instance'. 

AWS Ec2 Instance

Step 2: Go to SNS topic dashboard and click on create a topic.

Create SNS Topic

Step 3: You will be directed to this dashboard. Now specify the name and display name.

COnfigure SNS Topic

Step 4: Scroll down and click on create the topic.

Key value pair

Step 5: The SNS topic is created successfully. 

SNS topic Created

Add Subscribers

Step 1: Go to the SNS topic dashboard and click on gfgtopic link.

Add Subscription

Step 2: Under the subscriptions section, Click on Create subscription.

Click on create subcription

Step 3: Select Email as protocol and specify the email address of subscribers in Endpoint. Click on create the subscription. Now Go to the mailbox of the specified email id and click on Subscription confirmed.

Configure details

Craft the CloudWatch Alarm

Step 1: Go to the CloudWatch dashboard on the AWS management console. Click on Metrics in the left pane.

Craft the CloudWatch Alarm

Step 2: In All metrics section click on EC2 

In All metrics section click on EC2 

Step 3: Click on Per-instance metrics.

Click on Per-instance metrics

Step 4: Select the instance you launched.

Select the instance you launched

Step 5: Go to Graphed metrics, click on the bell icon.

Go to Graphed metrics, click on the bell icon

Step 6: This dashboard shows the components of Amazon CloudWatch such as Namespace, Metric Name, Statistics, etc.

dashboard

Set the Threshold

Step 1: Select the greater threshold. Also, specify the amount( i.e. 80 ) of the threshold value. Click on Next.

Set the Threshold

Connect the Dots

Step 1: Click on Select an existing SNS topic, also mention the name of the SNS topic you created now.

Connect the Dots

Step 2: Specify the name of alarm and description which is completely optional. Click on Next and then click on Create alarm.

Create alarm.

Monitor your Instances using CloudWatch

Step 3: The alarm is successfully created.

Monitor your Instances using CloudWatch

Step 4: You can see the graph which notifies whenever CPU utilization goes above 80%.

CPU utilization goes above 80%.

 Use Cases for CloudWatch

  • CloudWatch can be used to monitor the performance of AWS resources, applications, and infrastructure components in real-time
  • CloudWatch allows users to set up alarms that trigger notifications or automated actions in response to changes in the state of their resources.
  • CloudWatch can be used to store, search, and analyze log data from various AWS services, applications, and infrastructure components.
  • CloudWatch can be used to monitor the performance of EC2 instances, RDS databases, and other resources, which can then be used to trigger automatic scaling events.

Benefits of Amazon CloudWatch

  • A large amount of data is produced by web applications nowadays so amazon CloudWatch acts as a dashboard that contains the organized collection of whole data.
  • It improves the total cost of ownership by providing alarms and also takes automated actions when there is an error in limits provided.
  • Applications and resources can be optimized by examining the logs and metric data.
  • Detailed Insights from the application are provided through data like CPU utilization, capacity utilization, memory utilization, etc.
  • It provides a great platform to compare and contrast the data produced by various AWS services.

Draw Backs of Amazon CloudWatch

  • Cloud Watch can be expensive, especially for large-scale monitoring and logging needs.
  • Cloud Watch may not be able to handle large amounts of log data, especially during spikes in usage, making it difficult to maintain a consistent level of monitoring and logging.
  • The monitoring and logging processes of CloudWatch can consume significant system resources, impacting the overall performance of an application.
  • Integrating CloudWatch with other AWS services and third-party tools can be challenging.
  • Setting up and managing CloudWatch can be complex, especially for users who are not familiar with cloud-based systems.

Challenges of CloudWatch

  • Complexity in Setup: Setting up CloudWatch monitoring and configuring alarms can be challenging, especially for users who are new to AWS. Understanding which metrics to monitor and how to interpret them effectively requires familiarity with AWS services and best practices.
  • Limited Visibility and Granularity: CloudWatch provides metrics and logs at a high level, which may lack the granularity needed for detailed analysis and troubleshooting. Users may encounter difficulty in pinpointing the root cause of issues due to limited visibility into specific system components or resources.
  • Cost Management: CloudWatch costs can accumulate, particularly when monitoring a large number of resources or enabling detailed logging and retention settings. Users need to carefully manage and optimize their CloudWatch configurations to avoid unexpected charges while ensuring adequate monitoring coverage.

Amazon CloudWatch Pricing

Amazon cloud watch offers different pricing as following.

  • Free Tier: Amazon cloud watch offers free tier up to 7 metrics, 3 alarms and 500 custom dashboards per month and log storage up to 5 Gb per month.
  • Pay-as-you-go: You will be charged according to the base charge like each metric had its base charge and log will be charged based on per gb for dashboard you will be charged according to the per dash board. You will basically charged according to how much you use.

CloudWatch vs. CloudTrail

AspectCloudWatchCloudTrail
FunctionMonitoring and observability service for AWS resources, collecting and tracking metrics, and managing alarms.Auditing and logging service capturing API activity and providing a history of AWS API calls for governance, compliance, and security analysis.
Use CasesMonitoring performance metrics, logs, and events to troubleshoot issues, optimize resource utilization, and maintain application health.Tracking API activity and changes to AWS resources, auditing user activity, and generating actionable insights for security analysis and compliance auditing.
Key FeaturesMetric collection, dashboards, alarms, logs, and events for real-time monitoring and automated responses.Logging of API calls, including details such as the identity of the caller, the time of the call, the source IP address, and the request parameters. Enables analysis, compliance reporting, and troubleshooting.

Next Article
AWS CloudTrail
author
_shreya_garg_
Improve
Article Tags :
  • Cloud Computing
  • Cloud-Computing
  • AWS

Similar Reads

    Amazon Web Services (AWS) Tutorial
    Amazon Web Service (AWS) is the world’s leading cloud computing platform by Amazon. It offers on-demand computing services, such as virtual servers and storage, that can be used to build and run applications and websites. AWS is known for its security, reliability, and flexibility, which makes it a
    13 min read
    Introduction to Amazon Web Services
    Amazon Web Services (AWS) is one of the world's leading cloud platforms in providing the web services of various domains. AWS follows the trends of digital IT and comes up needy services with optimized performances covering a wide range of services from Compute to Storage. It covers a wider range of
    12 min read
    Amazon Web Services (AWS) - Free Tier Account Set up
    Creating an AWS account is the first step to access these powerful tools. Once your account is set up, you'll be able to use AWS's vast range of services, making it easier to manage and scale applications. In this article, you'll learn the process of setting up your AWS account and logging into the
    7 min read

    Compute Services

    What is Elastic Compute Cloud (EC2)?
    EC2 stands for Elastic Compute Cloud a service from Amazon Web Services (AWS). EC2 is an on-demand computing service on the AWS cloud platform. It lets you rent virtual computers to run your applications. You pay only for what you use. Instead of buying and managing your own servers, EC2 gives you a
    10 min read
    AWS Lambda
    AWS Lambda is a powerful serverless computing service that automatically runs code in response to events, without requiring you to manage the underlying infrastructure. It supports event-driven applications triggered by events such as HTTP requests, DynamoDB table updates, or state transitions. You
    11 min read
    Amazon Elastic Container Service (ECS)
    Amazon Elastic Container Service (ECS) is a fully managed service that enables users to run Docker-based applications in containers across a cluster of EC2 instances. ECS simplifies container orchestration, allowing you to deploy, manage, and scale containerized applications efficiently. The service
    11 min read

    Storage Services

    Introduction to AWS Simple Storage Service (AWS S3)
    AWS offers a wide range of storage services that can be configured depending on your project requirements and use cases. AWS comes up with different types of storage services for maintaining highly confidential data, frequently accessed data, and often accessed storage data. You can choose from vari
    13 min read
    Introduction to AWS Elastic Block Store(EBS)
    AWS Storage Services: AWS offers a wide range of storage services that can be provisioned depending on your project requirements and use case. AWS storage services have different provisions for highly confidential data, frequently accessed data, and the not so frequently accessed data. You can choos
    6 min read
    Amazon RDS - Introduction to Amazon Relational Database System
    Amazon RDS Is a relational database management system along with the facilities of the AWS cloud platform. It facilitates us in creating database instances as per our requirements, i.e. resizable, variety of database types, etc. Table of ContentWhat is Amazon Relational Database Service (Amazon RDS)
    15+ min read

    AWS Networking Services

    Amazon VPC - Introduction to Amazon Virtual Private Cloud
    Amazon VPC or Amazon Virtual Private Cloud is a service that allows its users to launch their virtual machines in a protected as well as isolated virtual environment defined by them. You have complete control over your VPC, from creation to customization and even deletion. It's applicable to organiz
    8 min read
    Introduction to Amazon Route53
    In Simplest terms, cloud computing means storing and accessing the data and programs on remote servers hosted on the internet instead of the computer’s hard drive or local server. It is also referred to as Internet-based computing. In this article we guide on discussing what is Amazon Route53, how d
    13 min read
    Amazon VPC - Working with Direct Connect Service
    Amazon Virtual Private Cloud or Amazon VPC is a service that enables customers to create their virtual network in a secure and Isolated environment. VPC offers us a secure environment in which we can create our network and use Amazon services as needed. You can have full control over VPC. whether it
    4 min read

    AWS Database Services

    AWS DynamoDB - Creating a Table
    DynamoDB allows users to create databases capable of storing and retrieving any amount of data and comes in handy while serving any amount of traffic. It dynamically manages each customer’s request and provides high performance by automatically distributing data and traffic over servers. It is a ful
    2 min read
    What is Amazon Aurora? In Detail Explanation
    A Cloud database is a database service fabricated and accessed through a cloud platform. It serves a considerable lot of indistinguishable functions as a conventional database with the additional adaptability of cloud computing. Users install the software on a cloud framework to implement the databa
    11 min read
    Difference between Amazon Redshift and PostgreSQL
    Choosing the right database can greatly affect how well your data is managed and analyzed. Amazon Redshift and PostgreSQL are two popular options, each with unique strengths. Amazon Redshift is a powerful data warehouse designed for handling large-scale data analysis, while PostgreSQL is a flexible,
    3 min read

    AWS Machine Learning Services

    What is SageMaker in AWS?
    Machine Learning is the hottest topic in the current era and the leading cloud provider Amazon web service (AWS) provides lots of tools to explore Machine Learning, creating models with a high accuracy rate. This article makes you familiar with one of those services on AWS i.e Amazon Sagemaker which
    13 min read
    What is AWS Deeplens?
    Pre-requisite: AWS AWS Deeplens is a deep learning-enabled video camera that is developed by Amazon Web Services (AWS). It is designed to make it easy for developers to create and deploy deep learning models on edge devices, such as cameras and robots. With Deeplens, developers can use pre-built mod
    3 min read

    AWS Developer Tools

    Working with AWS CodeCommit
    AWS CodeCommit is a source control service that is provided by Amazon Web Service which is fully managed. It is a version code service. It helps to manage and store assets such as codes or documents or any other type of file such as binary file etc. It allows the team to work collaboratively in a se
    4 min read
    How to Build a CI/CD Pipeline with AWS?
    Building and deploying code manually every time takes a lot of effort and can lead to mistakes. A CI/CD pipeline makes this easier by automating testing, building, and deploying your code for you. Now you might wonder, "Why should I use AWS for this when tools like Jenkins or GitLab CI already exist
    13 min read
    How to Build a AWS Data Pipeline?
    Amazon Web Services (AWS) is a subsidiary of Amazon offering cloud computing services and APIs to businesses, organizations, and governments. It provides essential infrastructure, tools, and computing resources on a pay-as-you-go basis. AWS Data Pipeline is a service that allows users to easily tran
    6 min read

    AWS Management and Monitoring

    Introduction to Amazon CloudWatch
    Amazon CloudWatch is a service used for monitoring and observing resources in real-time, built for DevOps engineers, developers, site reliability engineers (SREs), and IT managers. CloudWatch provides users with data and actionable insights to monitor their respective applications, stimulate system-
    10 min read
    AWS CloudTrail
    AWS With the help of a tool called Cloud Trail, offered by Amazon Web Services (AWS), you can keep track of and document activities that take place inside your AWS infrastructure. It gives you a thorough event history of every activity users, services, and resources took while using your AWS account
    10 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences