AWS CloudWatch

 AWS CloudWatch



AWS CloudWatch - 
  • AWS CloudWatch is a monitoring service for AWS cloud resources and the application you run on AWS
  • CloudWatch is is to collect and track metrics, collect and monitor log files, and set alarms
  • CloudWatch alarms monitor metrics and can be configured to automatically initiate actions
  • CloudWatch logs centralizes logs from systems, applications, and AWS Services
  • CloudWatch events delivers a stream of system events that describe and changes in AWS resources
  • CloudWatch is serverless performance monitoring service 
  • CloudWatch integrates with AWS IAM


Metrics - 
  • Metrics are the fundamental concept in CloudWatch
  •  A metrics represents a time-ordered set of data points that are published 
  • Up to 30 dimensions per metrics
  • Dimension in an attribute to the metrics
  • Metrics exist within a region
  • Metrics cannot be deleted but automatically expire after 15 months
Custom Metrics - 
  • You can publish your own metrics to CloudWatch using the AWS CLI or an API
  • You can view statistical graphs of your published metrics with the AWS management console 
  • CloudWatch stores data about metric as series of data points
  • Each data point has an associate timestamp
  • You can even publish an aggregated set of data points called a statistic sets
High-Resolution Metrics - 
  • Metrics produced by AWS services are standard resolution by default 
  • When you publish custom metrics, you can define it as either standard resolution or high resolution
  • When you publish a high-resolution metrics, CW stores it with resloution of 1sec, and you can read and retrieve it with a period of 1/5/10/30 sec or any multiple of 60 sec
  • High-resolution metrics can give you more immediate insight into your applications sub minute activity 
  • Keep in mind that PutMetricData call for a custom metrics is charged, so calling PutMetricData more often on a high resolution metric can lead to higher charges 
  • There is a higher charge for high-resolution alarms with a period of 10 or 30 secs

NameSpaces - 
  • A namespace is a container for CloudWatch metrics 
  • Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statisticss

CloudWatch Alarms - 
  • You can use an alarm to automatically initiate actions on your behalf 
  • An alarms watches a single metrics over a specified time period, and performs one or more specified actions, based on the value of metrics relative to the threshold overr time
  • The action is a notification sent to an AWS SNS or ASG Policy
  • You can also add alarms to dashboard 
  • Alarms invoke actions for sustained state changes only 
  • CloudWatch alarms do not invoke actions simply because they are in a particular state 
  • The state must have changed and been maintained for a specified no. of period 




CloudWatch Logs -
  • AWS CloudWatch logs lets you monitor and troubleshoot your systems and applications using your esisting system, application, custom log files
  • You can use AWS CloudWatch logs to monitor, store, and access your log files from EC2 instances, AWS CloudTrail, Route 53, and opther sources 
  • CW logs can be used for real time application and system monitoring aas well as long term log retention 
  • Cloudtrail logs can be sent to CW logs for real time monitoring
  • CW log metrics filters can evaluate CloudTrail logs for specific terms, phrases or values
  • Export to S3 CreateExportTask – takes 21 hours
  • CW log insight can be used to query logs and add queries to CW dashboard
  • Logs from multiple accounts and regions can be aggregated using subscription filters 
  • Metrics filters are part of CW logs (not CW metrics)



CW Logs Agent - 
  • The CW agents provide an automated way to send logs data to CW logs from EC2 instance 
  • There is now unified CW agent that collects both loggs and metrics
  • The unifies CW agents incudes metrics such as memory and disk utillization 




CloudWatch Events - 
  • AWS CW events delivers a real time stream of systems events that describe changes in AWS resources
  • Can you use CW events to scheduled automated actions that self trigger at certain times using cron or rate expressions
  • Can match events and route them to one or more target functions or streams 
  • In the following Ex. an EC2 instance changes state (terminate) and the event is sent to CW events which forwards the event to the target (SQS queue) 

Comments

Popular posts from this blog

AWS Instance Store

AWS Identity and Access Management

Elastic Block Storage (EBS)