20. Monitoring (CloudWatch, X-Ray, CloudTrail) Flashcards

1
Q

What does distributed tracing provided by X-Ray help with?

A

Distributed tracing helps pinpoint where failures occur and what causes POOR PERFORMANCE.

This is especially useful for applications built using a microservices architecture.

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

X-Ray receives data from services as _______ .

A

Segments

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

X-Ray groups segments that have a common request into _______ .

A

Traces

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

X-Ray processes traces to generate a _______ that provides a visual representation of your app.

A

Service Graph

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

Where would you look to identify bottlenecks or latency spikes in your application?

A

X-Ray Service Graph

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

True or False: By default, the X-Ray SDK records every request made.

A

False.

By default, the X-Ray SDK records the first request each second, and 5% of any additional requests (you can modify this).

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

In X-Ray, how do you narrow down specific paths or users?

A

Filter Expressions

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

What is an X-Ray annotation?

A

Annotations are aggregated at the trace level and can be added to any segment/subsegment.

Annotations are key/value pairs that are INDEXED for use with filter expressions.

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

What is an X-Ray metadata?

A

Metadata are aggregated at the trace level and can be added to any segment/subsegment.

Metadata are key-value pairs that are NOT indexed. The values can be of any type, including objects and lists.

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

When should you use X-Ray annotations?

A

Use annotations to record data that you want to use to group traces in the console, or when calling the GetTraceSummaries API.

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

When should you use X-Ray metadata?

A

Use metadata to record data you want to store in the trace but don’t need to use for searching traces.

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

What languages does X-Ray support?

A
  1. ASP.NET
  2. Go
  3. Java
  4. NodeJS
  5. PHP
  6. Python
  7. Ruby
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the X-Ray tracing header?

A

X-Amzn-Trace-Id

It identifies a trace which is passed along to downstream services

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

How can you utilize Groups in X-Ray?

A

Groups allow you to save FilterExpressions so you can quickly filter traces

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

What is the X-Ray throttling error code?

A

429 Too Many Requests

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

What are the X-Ray Fault error codes?

A

Faults are 500/5xx errors

Errors are 400/4xx errors

17
Q

How do you enable AWS X-Ray?

A
  1. Your code (Java, Python, Go, Node.js, .NET) must import the AWS X-Ray SDK
  2. Install the X-Ray daemon or enable X-Ray AWS Integration
18
Q

What is X-Ray?

A
  • Automated Trace Analysis & Central Service Map Visualization
  • Latency, errors, and fault analysis
  • Request tracking across distributed systems
  • provides an end-to-end view of requests as they travel through your application, and shows a map of your application’s underlying components
19
Q

What is CloudTrail?

A
  • Audit API calls made by users, services, AWS console
  • Useful to detect unauthorized calls or root cause of changes
  • a service that enables governance, compliance, operational auditing, and risk auditing of your AWS account.
20
Q

What is CloudWatch?

A
  • CloudWatch Metrics over time for monitoring
  • CloudWatch Logs for storing application logs
  • CloudWatch Alarms to send notifications in case of unexpected metrics
  • provides you with data and actionable insights to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health
21
Q

What should you check if X-Ray is not working on EC2?

A

ensure EC2 IAM Role has proper permissions

2. ensure EC2 instance is running X-Ray Daemon

22
Q

What should you check if X-Ray is not working on Lambda?

A
  1. ensure it has an IAM execution role with proper policy (AWSX-RayWriteOnlyAccess)
  2. ensure that X-Ray is imported in the code
23
Q

What is the CloudWatch Logs API to associate a KMS key if the log group already exists?

A

associate-kms-key

24
Q

What is the CloudWatch Logs API to associate a KMS key if the log group doesn’t exist?

A

create-log-group

25
If a resource is deleted in AWS, where should you look first?
CloudTrail
26
What is a CloudWatch Metric?
Metric is a variable to monitor (CPUUtilization, NetworkIn, etc)
27
What is a CloudWatch Dimension?
Dimension is an attribute of a metric (instance id, environment, etc)
28
What is the default CloudWatch EC2 instance metric time?
EC2 instance metrics have metrics every 5 minutes by default
29
How often can you receive metrics with CloudWatch detailed monitoring (for a cost)?
With detailed monitoring, you get data every 1 minute
30
Encryption of CloudWatch logs using KMS is at what level?
Encryption of logs using KMS is at the Group Level
31
How do you send CloudWatch logs from your EC2?
By default, no longs from your EC2 machine will go to CloudWatch. You need to run a CloudWatch agent on EC2 to push the log files you want. Make sure IAM permissions are correct
32
What do you use to collect additional system-level metrics?
CloudWatch Unified Agent | upgrade from CloudWatch Logs Agent