Section 11: AWS Monitoring & Audit: CloudWatch, X-Ray and CloudTrail Flashcards
What do our users care about?
That our application is working!
Why is monitoring important?
We want to be aware if our application latency increases, if we have outages, or if our applications donโt behave as we expect them to.
What does internal monitoring provides us?
See performance and cost
Detect trends
Learn and improve
What are the three monitoring services offered by AWS?
CloudWatch
X-Ray
CloudTrail
What is AWS CloudTrail used for?
Internal monitoring of API call being made to AWS
Audit changes to AWS Resources by users
What is AWS X-Ray used for?
Troubleshooting application performance and errors
Visual tracing of microservices
What are the four features provided by AWS CloudWatch?
Metrics
Logs
Events
Alarms
What is AWS CloudWatch Metrics?
A fully managed service that provides metrics for every service in AWS
What is a Metric?
A variable to monitor (CPUUtilization, NetworkIn, etc.)
What is namespace in AWS CloudWatch Metrics?
A container for metrics
What are some default metrics namespaces?
EBS, EC2, ELB, RDS, ElasticBeanstalk, etc. (Basically most AWS services have their own namespaces provided by AWS)
Can you create your own Metrics namespace?
Absolutely
What are dimensions and what are they used for? (In the context of Metrics)
Metrics are first grouped by namespace, and then by the various dimension combinations. For example:
All EC2 Metrics
EC2 Metrics grouped by instance
EC2 Metrics grouped by ASG
Do all AWS services send metrics to CloudWatch by default?
Only the services you are using
How many dimensions can a metric have?
Up to 10
What is the one thing that all metrics have?
Timestamps
How can we visualize metrics better?
By creating a custom dashboard of Metrics
What is default period between each metric for an EC2 instance?
5 minutes
How can you get more frequent metrics for an EC2 instance?
By enabling โDetailed monitoringโ (for a cost)
What is shortest period between each metric for an EC2 instance with detailed monitoring?
1 minute
What metric is NOT pushed to AWS CloudWatch for EC2 instances?
Memory usage
How can you push EC2 Memory usage metric to CloudWatch?
By pushing it as a custom metric
How many detailed metrics does AWS Free Tier allow us to have?
10
What can you do if you want to more prompt scale your ASG?
Enable detailed monitoring
How can you segment metrics when you send your own custom metrics to CloudWatch?
By using dimensions
How to get more frequent metrics when using custom metrics?
By using custom High Resolution custom metric
What are the two types of custom metric?
Standard resolution
High resolution
What is the granularity of custom metric with standard resolution?
1 minute
What is the granularity of custom metric with high resolution?
1 second
What are the available periods of analysis of custom metrics of high resolution in CloudWatch?
1 sec, 5 sec, 10 sec, 30 sec, any multiple of 60 sec
What API should you use to emit custom metrics?
PutMetricData
How can you set a custom metric to high resolution?
By setting the StorageResolution API parameter to any values under 60 (which would be 60 seconds therefore standard resolution)