CloudWatch Flashcards
What is CloudWatch?
is a monitoring and management service that provides data and actionable insights for AWS, hybrid, and on-premises applications and infrastructure resources
What services obtain the benefits of CloudWatch metrics?
every service
What is a CloudWatch dimension?
is a name/value pair attribute that is part of the identity of a metric (instance id, environment, etc…)
What is a CloudWatch metric?
a variable to monitor, with data points representing the values of that variable over time
What is a CloudWatch metric namespace?
is a container for CloudWatch metrics. Metrics in different namespaces are isolated from each other
What can you create on CloudWatch from metrics?
dashboards
How often do EC2 instances have metrics?
5 minutes
Using CloudWatch detailed monitoring how fast can you get data from EC2 instances metrics?
every 1 minute at a cost
How many detailed monitoring metrics are allowed by CloudWatch in the free tier?
10
By default what is not pushed from EC2 instances to CloudWatch metrics?
Memory usage is by default not pushed (must be pushed from inside the instance as a custom metric)
What is a CloudWatch custom metric?
You can publish your own metrics to CloudWatch using the AWS CLI or an API
Can you use dimentions on custom metrics?
yes
What is the standard resolution time for custom metrics?
1 min
What is the high resolution time for custom metrics?
up to 1 second using StorageResolution API parameter - higher cost
What is the API for sending custom metrics?
PutMetricData
What you need to do if you get an error while sending a custom metric?
Use exponential back off
What are CloudWatch Dashboards?
are customizable home pages in the CloudWatch console that you can use to monitor your resources in a single view, even those resources that are spread across different Region
What graphs can you include in CloudWatch Dashboards?
it is global, can include graphs from different regions
What can be sent to Cloudwatch in addition to metrics?
You can use CloudWatch Logs to monitor applications and systems using log data
What is used by applications to send logs to CloudWatch?
SDK
Where can CloudWatch logs go to?
- Batch exporter to S3 for archival
* Stream to ElasticSearch cluster for further analytics
What is composed of CloudWatch logs storage architecture?
- Log groups: arbitrary name, usually representing an application
- Log stream: instances within application / log files / containers
Does CloudWatch logs expire?
you can set expiration policies (never, 30 days, etc)
What can you do with CLI regarding CloudWatch logs?
you can tail
What you need to send logs to CloudWatch?
correct IAM permission
What security is provided for CloudWatch logs?
encryption of logs using KMS at the Group Level
What can you use to for example find a specific IP or count occurrences of “ERROR” inside of a CloudWatch log?
use CloudWatch Logs filter expressions to create Metric Filters
What is CloudWatch Logs Insights?
can be used to query logs and add queries to CloudWatch Dashboards (u can write your own)
What are CloudWatch alarms?
allows you to watch CloudWatch metrics and to receive notifications when the metrics fall outside of the levels (high or low thresholds) that you configure
What are the CloudWatch states?
- OK
- INSUFFICIENT_DATA
- ALARM
What is the CloudWatch alarm period?
Length of time in seconds to evaluate the metric
What is a CloudWatch event?
delivers a near real-time stream of system events that describe changes in AWS resources
What can a CloudWatch Event trigger?
Lambda function, SQS, SNS Kinesis messages
What is created by CloudWatch Events about the change?
small JSON documents to give information about the change
What can you use in CloudWatch events?
- Scheduled actions
- Event Pattern to react to a service doing something
Set an example of what a CloudWatch event could react to
CodePipeline state changes
How many dimensions can you define in a metric?
up to 10
How are logs sent from EC2 instances to CloudWatch?
- By default, no logs from your EC2 machine will go to CloudWatch
- You need to run a CloudWatch agent on EC2 to push the log files you want
How can you send logs from on-prem instances to CloudWatch?
using the CloudWatch Agent
What you need to do after you run the CloudWatch agent in your instance to make sure that logs are being sent successfully?
Make sure IAM permissions are correct
What is the CloudWatch Unified Agent?
A newer and better version of the Log Agent that:
o Collect additional system-level metrics such as RAM, processes, etc.…
o Centralized configuration using SSM Parameter Store
What data is filtered by CloudWatch Logs Filter Expressions?
Filters do not retroactively filter data. Filters only publish the metric data points for events that happen after the filter was created
Where can CloudWatch alarms go to?
Auto Scaling, EC2 Actions, SNS notifications
What options can you use to define CloudWatch Alarms?
Various options (sampling, %, max, min, etc…)
What is the Normal Metrics Alarm period range?
Normal metrics from 1 minute (default) to 1 day
What is the High Resolution Custom Metrics Alarm period range?
High resolution custom metrics: 10 sec or 30 sec
What are CloudWatch Alarm Evaluation Periods?
Is the number of the most recent periods, or data points, to evaluate when determining ALARM state
What are CloudWatch Alarm Data points?
Is the number within the Evaluation Periods that must be breaching to cause the alarm to go to the ALARM state
What is the CloudWatch Alarm evaluation interval?
The evaluation interval is the number of data points multiplied by the evaluation period.
If I define a CloudWatch Alarm saying “4 out of 5” in intervals of 2 minutes… Mention:
- Datapoints
- Evaluation Periods
- Evaluation Interval
- Period
- Datapoints = 4
- Evaluation Periods = 5 datapoint
- Evaluation Interval = 10 minutes
- Period = 2 minutes
What is EventBridge?
EventBridge is the next evolution of CloudWatch Events by extending its power
What is included in EventBridge?
- It includes the Default event bus
- Partner event bus
- Custom Event buses
What is the CloudWatch default event bus?
It is generated by AWS services and it is the only one used by CloudWatch Events
What is used for the EventBridge Partner event bus?
receive events from SaaS service or applications (Zendesk, DataDog, Segment, Auth0…)
What is used for the Custom Partner event bus?
For your own applications
Can CloudWatch event buses be accessed by other accounts?
yes
What is the EventBridge Schema Registry?
The Schema Registry allows you to generate code for your application, that will know in advance how data is structured in the event bus. Schema can be versioned
What can EventBridge do by analyzing the events in your bus?
EventBridge can analyze the events in your bus and infer the schema registry