Section 11: AWS Monitoring & Audit: CloudWatch, X-Ray and CloudTrail Flashcards

1
Q

What do our users care about?

A

That our application is working!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is monitoring important?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does internal monitoring provides us?

A

See performance and cost
Detect trends
Learn and improve

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three monitoring services offered by AWS?

A

CloudWatch
X-Ray
CloudTrail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is AWS CloudTrail used for?

A

Internal monitoring of API call being made to AWS

Audit changes to AWS Resources by users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is AWS X-Ray used for?

A

Troubleshooting application performance and errors

Visual tracing of microservices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the four features provided by AWS CloudWatch?

A

Metrics
Logs
Events
Alarms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is AWS CloudWatch Metrics?

A

A fully managed service that provides metrics for every service in AWS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Metric?

A

A variable to monitor (CPUUtilization, NetworkIn, etc.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is namespace in AWS CloudWatch Metrics?

A

A container for metrics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are some default metrics namespaces?

A

EBS, EC2, ELB, RDS, ElasticBeanstalk, etc. (Basically most AWS services have their own namespaces provided by AWS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can you create your own Metrics namespace?

A

Absolutely

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are dimensions and what are they used for? (In the context of Metrics)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Do all AWS services send metrics to CloudWatch by default?

A

Only the services you are using

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How many dimensions can a metric have?

A

Up to 10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the one thing that all metrics have?

A

Timestamps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How can we visualize metrics better?

A

By creating a custom dashboard of Metrics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is default period between each metric for an EC2 instance?

A

5 minutes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How can you get more frequent metrics for an EC2 instance?

A

By enabling โ€œDetailed monitoringโ€ (for a cost)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is shortest period between each metric for an EC2 instance with detailed monitoring?

A

1 minute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What metric is NOT pushed to AWS CloudWatch for EC2 instances?

A

Memory usage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How can you push EC2 Memory usage metric to CloudWatch?

A

By pushing it as a custom metric

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How many detailed metrics does AWS Free Tier allow us to have?

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What can you do if you want to more prompt scale your ASG?

A

Enable detailed monitoring

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How can you segment metrics when you send your own custom metrics to CloudWatch?
By using dimensions
26
How to get more frequent metrics when using custom metrics?
By using custom High Resolution custom metric
27
What are the two types of custom metric?
Standard resolution | High resolution
28
What is the granularity of custom metric with standard resolution?
1 minute
29
What is the granularity of custom metric with high resolution?
1 second
30
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
31
What API should you use to emit custom metrics?
PutMetricData
32
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)
33
What should you do in case of throttle errors when sending custom metrics?
Use exponential back off
34
What are CloudWatch Alarms used for?
They are used to trigger notifications for any metric
35
What can alarms go to?
Auto Scaling, EC2 actions, SNS notifications
36
What are the possible alarm states?
OK INSUFFICIENT_DATA ALARM
37
What is the period of CloudWatch Alarms for standard resolution custom metrics and metrics provided by AWS?
The length of time in seconds to evaluate the metric
38
What is the period of CloudWatch Alarms for high resolution custom metrics?
Can only choose 10 sec or 30 sec
39
What does the AWS CloudWatch Logs panel allow you to do?
View logs from used AWS services
40
What logs does EB can send to CloudWatch?
Logs from the application
41
What logs does ECS can send to CloudWatch?
Logs from containers
42
What logs does Lambda can send to CloudWatch?
Function logs
43
What logs does VPC Flow Logs can send to CloudWatch?
VPC specific logs
44
What logs does API Gateway can send to CloudWatch?
API related logs
45
What logs does Route53 can send to CloudWatch?
DNS queries logs
46
Where can CloudWatch logs go to? (2 options)
Batch export to S3 | Stream to ElasticSearch cluster for further analysis
47
What can you use to filter logs in CloudWatch Logs?
Filter expressions
48
What is the Logs storage architecture?
Log groups | Log streams
49
What are Log groups?
Groups of log streams
50
What are Log streams?
Instances within applications, log files, containers, functions, etc.
51
Can you define expiration policies?
Yes (never expire, 30 days, etc.)
52
What do your services ABSOLUTELY need to have in order to be able to send logs to CloudWatch?
The right IAM permissions!
53
Is encryption available for logs in CloudWatch Logs?
Yes, encryption of logs is available using KMS
54
At what level is encryption availble in CloudWatch Logs?
At the group level
55
What is CloudWatch Events?
They are a way to schedule cron jobs or react to a service doing something
56
What can CloudWatch Events trigger?
Lambda functions | SQS/SNS/Kinesis Messages
57
What do CloudWatch Events create when triggered?
A small JSON document to give information about the change
58
What was the good old way to do debugging when a problem occurred in production?
Test locally Add log statements everywhere Re-deploy in production
59
What is the hardest to debug when using the good old way, a monolith or distributed services? And why so?
A monolith, because with distributed services you don't have common views or your architecture.
60
What are some of the things that X-Ray helps you detect?
Bottlenecks Service issues Impacted users
61
What services/other things are compatible with X-Ray?
``` AWS Lambda Elastic Beanstalk ECS ELB API Gateway EC2 Instances or any application server (even on premise) ```
62
What does X-Ray leverages?
Tracing
63
What is tracing?
It is an end to end way to following "a request"
64
What do each components dealing with the request add?
Their own "trace"
65
What are traces made of?
Segments (and sub segments)
66
How can you provide extra-information to your traces?
By adding annotations
67
Do you have to trace every request when using X-Ray?
No, you can use sampling to sample request (as a % or a rate per minute)
68
How is X-Ray secure?
IAM for authorization | KMS for encryption at rest
69
How can you enable X-Ray in your application running on EC2 instances / on premise servers?
Import the AWS X-Ray SDK in your code Configure the SDK to capture calls to AWS services, HTTP/HTTPS requests, database calls, queue calls (SQS) Install and run the X-Ray daemon
70
What is the X-Ray daemon?
A software application that listens for traffic on UDP port 2000, gathers raw segment data, and relays it to the AWS X-Ray API
71
How can you enable X-Ray in your application running on Elatic Beanstalk?
Import the AWS X-Ray SDK in your code Configure the SDK to capture calls to AWS services, HTTP/HTTPS requests, database calls, queue calls (SQS) Set the configuration in the EB console OR enable the service in a .ebextensions/xray-daemon.config file like so: option_settings: aws:elasticbeanstalk:xray: XRayEnabled: true
72
How can you enable X-Ray in functions running on Lambda?
Import the AWS X-Ray SDK in your code Configure the SDK to capture calls to AWS services, HTTP/HTTPS requests, database calls, queue calls (SQS) Make sure that X-Ray integration is enabled
73
What do all applications, regardless of the platform, absolutely need in order to relay data to X-Ray?
The corresponding IAM rights
74
How can you send traces cross-account with the X-Ray daemon / agent?
The agent has a config to send traces cross account, make sure the IAM permissions are correct - the agent will assume the role
75
How to reduce cost when using X-Ray?
By using sampling
76
What can you use to provide key value pairs which can be used for filtering when using X-Ray?
Annotations
77
What can you use to provide key value pairs which can NOT be used for filtering when using X-Ray?
Metadata
78
What does AWS CloudTrail provide?
Governance, compliance and audit for your AWS Account
79
Is CloudTrail enabled by default?
Yes
80
What are the sources of events in CloudTrail?
Console SDK CLI AWS Services
81
Can you put logs from CloudTrail into CloudWatch Logs?
Yes
82
What should you do if you feel like something weird happened into your AWS account?
Look into CloudTrail first