Cloudwatch, X-Ray, and monitoring Flashcards

1
Q

There are 4 things that a cloudwatch event can trigger. One of these is a lambda function. What are the other 3?

A

Cloudwatch can also trigger events to:
SQS
SNS
Kinesis

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

How many dimensions can you have per metric in Cloudwatch?

A

10

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

What is the default measurement period for Cloudwatch metrics?

A

5 minutes

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

What is the measurement period for a detailed Cloudwatch metric and why would you use it?

A

1 minute and you would use it to make your autoscaling group more responsive to metric changes.

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

Can you monitor an EC2 instances RAM through Cloudwatch natively?

A

No, you need a cloudwatch custom metric.

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

What is the granularity for a standard and high resolution custom metric?

A

Standard 1 Minute

High Res 1 second

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

Which API is used for sending custom metrics

A

PutMetric

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

We are sending custom metrics through to cloud watch, however we are seeing some throttling exceptions in cloud watch. What should we do

A

Implement exponential back-off

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

In Cloudwatch, what is the definition of a metric, namespace and dimension?

A

A metric is a variable to monitor (such as CPUUtilisation)

A namespace is a grouping of metrics

A Dimension is an attribute of a metric (such as instance ID)

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

In cloud watch, what are Group Metrics and what do they apply to? Are they enabled by default and what is the granularity?

A

Group metrics give you continuous visibility into the operations of your Auto Scaling groups so that you can quickly respond to changes in your workloads. They are NOT enabled by default and the granularity is 1 minute.

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

Your Cloudwatch alarm has returned INSUFFICIENT_DATA as its status. Whty

A

There are not yet enough data points for the alarm to be evaluated

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

On a high resolution custom metric, over what time periods does evaluation occur for a a cloud watch ALARM (2)

A

10 seconds

30 seconds

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

For CloudWatch logs, what is the logical storage architecture (i.e., how logs are grouped, not what they are stored on). How is encryption at rest achieved and at which logical level? Also, When defining a lifecycle policy at which logical level is this done?
What is the default, min and max expiration for CW Logs?

A

Log Groups: Arbitrary name, usually the name of the application
Log Stream: Logical streams of logs, such as logs from ECS containers, instances within the application stack, individual CodeBuild builds

Encryption at rest is achieved with KMS at the log group level

Life Cycle Policies are defined at the group level

Logs are kept indefinately by default with a min of 1 day and a max of 10 yrs

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

Do cloudwatch logs require any IAM setup?

A

Yes. To send logs to CW, whatever is sending them needs correct IAM permissions.

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

Where can Cloudwatch logs be archived to?

A

S3

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

What is required to allow logs on an EC2 instance to be streamed to CloudWatch in terms of software and permissions? Can you stream from on premise machines as well as EC2 instances?

A

The cloudwatch log agent needs to be installed, and the correct IAM permissions need to be in place to write to CW logs. Logs can be streamed from both ec2 and on premise instances.

17
Q

Whats the difference between the cloudwatch agent and the cloudwatch unified agent?

A

The CW Agent is the older agent implementation and only supports streaming of logs to CW. The Unified agent supports streaming of logs AND granular system metrics such as CPU, memory, disk, network IO, processes, swap.

18
Q

You need to integrate events from a third party SaaS application into Cloudwatch. Can this be done?

A

Yes by using Eventbridge which is an extension on CW Events allowing integration with 3rd party SaaS applications as well as creation of you own custom events for applications.

19
Q

What do you need to do to AWS enable x-ray for your application?

A
  1. You need to import the AWS X-Ray SDK into you code and and update
  2. Install the X-Ray Daemon or enable X-Ray integration if you are using Lambda
20
Q

If you want to include AWS X-Ray in an Elastic Beanshell stack, how would you do this?

A

You would create a config file in you .ebextenstions directory off the root of your applications source code and include the x-ray directives in the option_settings section

21
Q

What is the reservoir and rate with respect to AWS X-Ray? What are their default values?

A

The reservoir and rate control the number of samples sent to X-Ray. By default, the reservoir is set to send the first request of each second to X-Ray, and the rate is set to send 5% of additional requests in that second to X-Ray.

22
Q

How many requests will the following settings send to X-Ray assuming 50 requests/second:

1: Reservoir: 10 , Rate 0.10
2: Reservoir:1, Rate 1

If you change these rules in the X-Ray console, do you need to restart your application?

A

1: First 10 requests and additional 10% of requests thereafter
2: First request and then EVERY request thereafter

If you change the sampling rules, you don’t need an application restart, they will be picked up automatically.

23
Q

Your CloudWatch alarm is triggered and controls an ASG. The alarm should trigger 1 instance being deleted from your ASG, but your ASG has already 2 instances running and the minimum capacity is 2. What will happen and what will the alarm state be?

A

The ASG capacity won’t be reduced as we have a min value of 2. The alarm will stay in the “alarm” state

24
Q

We’d like to have CloudWatch Metrics for EC2 at a 1 minute rate. What should we do?
Enable Detailed Monitoring
Enable Hi Res Monitoring
Enable Custom Monitoring

A

Enable Detailed Monitoring will give you 1 minute granularity.

25
Q

My application traces appear in X-Ray when I run the application on my local laptop. When I deploy my application to my Elastic Beanstalk, the traces do not appear in X-Ray. Why?

A

If you are using Beanstalk, make sure that you have xray included in your .ebextensions.

26
Q

What would you use the following X-Ray API calls for?
PutTraceSegments
PutTelemetryRecords
GetSamplingRules

Which are these associated with reads or writes to the API?

A

PutTraceSegments: Uploads Segment Documents to X-Ray
PutTelemetryRecords: Uploads data about number of recieved and errored segments, connection errors etc (i.e. telemetry data)
GetSamplingRules: Get request so the the other API’s know what to sample, frequency etc

These are all associated with write API

27
Q
What would you use the following X-Ray API calls for?
GetServiceGraph
BatchGetTraces
GetTraceSummaries
GetTraceGraph
A

GetServiceGraph: The main X-Ray graph
BatchGetTraces: Retrieves a list of traces
GetTraceSummaries: Retrieves ID’s and annotations
GetTraceGraph: Retrieves service graph for a specified trace

28
Q

What do I need to do to enable X-Ray in a Beanstalk application? Do I need to do anything with the code or IAM?

A

The X-Ray Daemon is already included in Beanstalk, it will need to be enabled by either enabling it in theEB console, or creating an xray-daemon.config file in .ebextensions with the xrayenabled:true.
You need to make sure your code is instrumented and that the Daemon has the correct IAM permissions to write to the XRay API

29
Q

I am running an ECS cluster across two EC2 instances. Each instance has 10 application containers running. How many X-Ray daemons will I have in a daemon vs a sidecar model and what protocol and ports will the communicate over?

A

2 for a Daemon model (one per EC2 instance)
20 for a side car model (one per app container)
The protocol is UDP and the port is 2000

30
Q

If a resource is deleted in AWS and you want to find out when and by whom, which service would you use and what does it do?

A

Cloud Trail as this provides a history of events and API calls made by the console, CLI,SDK and other aws services.

31
Q

My application traces appear in X-Ray when I run the application on my local laptop. When I deploy my application to my EC2 instances with CODEDEPLOY, the traces do not appear in X-Ray. Why?

A

The X-Ray Daemon is not running. Remember, code deploy deploys onto EXISTING EC2 instances, so these will need to have the daemon running to work.

32
Q

In X-Ray are Annotations or Metadata values used for indexing and filtering?

A

Annotations are, Metadata is not. Both a key/value pairs.

33
Q

When encrypting Cloudwatch logs with Customer created KMS are logs encrypted at the group or the stream level? Can logs be encrypted via the console, and what access might I need to the KMS key?

A

Logs are encrypted at the GROUP level
Association with the CMK is done via the CLI
You CMK key policy will need to allow the Cloudwatch SERVICE access to the key.

34
Q

What is the role of an HTTP interceptor in X-Ray?

A

You add an HTTP interceptor to your code to allow tracing of inbound HTTP requests

35
Q

What is the role of a client handler in AWS XRay?

A

Client handlers are used to instrument AWS SDK clients that your application uses to call other AWS services

36
Q

I have X-Ray tracing set up for my application. Most of my app is built around AWS services, so the tracing works quite well. I do have a dependency on the NZ Post address look up service though and I would like the duration of these calls to show up on my X-Ray graph. What type of segment do I use in X-Ray to provide data for call duration on services or resources outside of AWS?

A

You use sub-segments to provide response time data for calls to services or resources that exist outside of AWS

37
Q
For an X-Ray segment - what are the minimal fields that need to be included to make it complete?
 name
 id
 start_time
 trace_id
 in_progress
end_time
A
name
id
start_time
trace_id
end_time
38
Q

In X-Ray, what does the HTTP client instrument (careful)?

A

The HTTP client is used instrument calls to other internal and external HTTP web services