Monitoring & Audit: CloudWatch, X-Ray, and CloudTrail Flashcards
(17 cards)
What are the main uses for the following 3 services?
1. CloudWatch
2. X-Ray
3. CloudTrail
CloudWatch - Metrics, Logs, Events, and alarms
X-Ray - Troubleshooting perofrmance and errors
CloudTrail - Monitoring of API calls and auditing changes to AWS resources
What is a CloudWatch metric?
What do CloudWatch metrics belong to?
What does is a Dimension in respect to a metric?
- It is a variable to monitor
- Metrics belong to a namespace
- A dimension is an attribute of a metric (like instance id, environment)
Which API call can you use to create a CloudWatch custom metric?
PutMetricData and define dimensions and metric resolution (StorageResolution)
What timespan will CloudWatch accept metrics from?
2 weeks in the past and 2 hours in the future.
Note: You should check your ec2 instance time to make sure its correct
Answer the following about CloudWatch logs:
1. What is a Log group
2. What is a Log stream
3. Where can Logs be sent to?
- Typically represents an application logs belong to
- Instances within the application
- They can be sent to s3, data streams, data firehose, aws lambda
Suppose you want to stream CloudWatch logs into an AWS service, when would you use each of the following AWS services?
1. Lambda
2. Kinesis Data Firehose
3. Kinesis Data Streams
- Sending realtime data to Open Search Service
- Sending near realtime data to S3 or Open Search Service
3.
How would you aggregate CloudWatch logs from multiple accounts and regions?
Stream data from multiple CloudWatch logs into Kinesis Data Streams and then into Kinesis Data Firehose which exports to Amazzon S3
What must you configured to send logs from EC2 to CloudWatch?
- Run a CloudWatch agent on EC2
- Make sure IAM permissions are correct
What is the difference between CloudWatch Logs Agent and CloudWatch Unified Agent?
CloudWatch Logs Agent - Only used for logs
CloudWatch Unified Agent - Can send metrics and logs
Do CloudWatch Metric Filters retroactively filter data?
No! Filters only publish the metric data points for events that happen after the filter was created
What are the 3 states for a CloudWatch alarm?
- OK
- INSUFFICIENT_DATA
- ALARM
What are the 3 main CloudWatch alarm targets?
- Stop, Teriminate, Reboot, or Recover an EC2 instance
- Triger an ASG action
- Send a notification to SNS
How can you create a metric that alerts based on multiple other CloudWatch alarms?
Use composite alarms with AND or OR conditions on other alarms
What statuses of an EC2 instance might you monitor in CloudWatch?
- Instance status (EC2 VM)
- System status (underlying hardward)
- Attached EBS status (attached EBS volumes)
Suppose you want to trigger a CloudWatch alarm based on recieving too many logs containing the string “Error”, how would you achieve this?
Create a CloudWatch metric filter that checks the log contains the string, and then a CloudWatch alarm ontop of this metric filter.
What is CloudWatch Synthetics Canary?
Allows you to programmatically test what users may do on your application using Canary Blueprints