AWS CloudWatch, X-Ray and CloudTrail Flashcards

1
Q

Whats the usage of AWS CloudWatch?

A
  • Metrics: Collect and track key metrics
  • Logs: Collect, monitor, analyze and store log files
  • Events: Send notifications when certain events happen in your AWS
  • Alarms: React in real-time to metrics / events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Whats the usage of AWS X-Ray?

A
  • Troubleshooting application performance and errors
  • Distributed tracing of microservices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Whats the usage of AWS CloudTrail?

A
  • Internal monitoring of API calls being made
  • Audit changes to AWS Resources by your users
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Whats a CW Metric?

A
  • Metric is a variable to monitor (CPUUtilization, NetworkIn…)
  • Metrics belong to namespaces
  • Dimension is an attribute of a metric (instance id, environment, etc…).
  • Up to 30 dimensions per metric
  • Metrics have timestamps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is EC2 Detailed monitoring?

A
  • EC2 instance metrics have metrics “every 5 minutes”
  • With detailed monitoring (for a cost), you get data “every 1 minute”
  • Use detailed monitoring if you want to scale faster for your ASG!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Does EC2 Memory usage pushed by default to CW?

A

Nope

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

Whats CW Custom Metrics?

A

Possibility to define and send your own custom metrics to CloudWatch.
* Use API call PutMetricData
* Ability to use dimensions (attributes) to segment metrics
* Metric resolution (StorageResolution API parameter – two possible value):
– Standard: 1 minute (60 seconds)
– High Resolution: 1/5/10/30 second(s) – Higher cost

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

Whats the time range where you can push CW Custom metrics?

A

Custom metrics can be pushed two weeks in the past and two hours in the future.

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

What are CW Logs?

A
  • Log groups: arbitrary name, usually representing an application
  • Log stream: instances within application / log files / containers
  • Can define log expiration policies (never expire, 30 days, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where can you send CW Logs?

A
  • Amazon S3 (exports)
  • Kinesis Data Streams
  • Kinesis Data Firehose
  • AWS Lambda
  • OpenSearch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the sources of the CW Logs?

A
  • SDK, CW Logs Agent, CW Unified Agent
  • Elastic Beanstalk: collection of logs from applications
  • ECS: collection from containers
  • AWS Lambda: collection from function logs
  • VPC Flow Logs: VPC specific logs
  • API Gateway
  • CloudTrail based on filter
  • Route53: Log DNS queries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is CW Metric Filter and Insights?

A
  • CloudWatch Logs can use filter expressions
  • Metric filters can be used to trigger CloudWatch alarms
  • CloudWatch Logs Insights can be used to query logs and add queries to CloudWatch Dashboards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is CW Metric Filter and Insights?

A
  • CloudWatch Logs can use filter expressions
  • Metric filters can be used to trigger CloudWatch alarms
  • CloudWatch Logs Insights can be used to query logs and add queries to CloudWatch Dashboards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How much time does it take to export CW Logs to S3?

A

It can take up to 12 hours.

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

What is the API call to export CW logs to s3?

A

CreateExportTask

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

What is CW Logs Subscription?

A

You can register real time handlers. It can send to:
* Lambda
* Kinesis Data Firehose
* Kinesis Data Stream

17
Q

How to aggregate Multi-Account / Multi Region logs?

A

With subscription filters directiong to one Kinesis Data Stream.

18
Q

Are CW logs sent by EC2 instances?

A

No, you need to run CW agent to push the log files. Make sure to use the correct IAM permissions

19
Q

What is CW Logs Agent?

A

Old agent version, can only push logs to CW Logs

20
Q

What is CW Unified Agent?

A

The newer agent version:
* Collect additional system-level metrics
* Collect logs to send to CW Logs
* Centralized confi using SSM Parameter Store

21
Q

What are the CW Unified Agent metrics?

A
  • CPU (active, guest, idle, system, user, steal)
  • Disk metrics (free, used, total), Disk IO (writes, reads, bytes, iops)
  • RAM (free, inactive, used, total, cached)
  • Netstat (number of TCP and UDP connections, net packets, bytes)
  • Processes (total, dead, bloqued, idle, running, sleep)
  • Swap Space (free, used, used %)
22
Q

What CW Logs Metric Filter?

A
  • Filter CW Logs by expression
  • Filters do not retroactively filter data. Its publish the metric data after it was created
23
Q

What is CW Alarm?

A
  • Alarms are used to trigger notifications for any metric
  • Various options (sampling, %, max, min, etc…)
24
Q

What are the CW Alarm states?

A
  • OK
  • INSUFFICIENT_DATA
  • ALARM
25
Q

What can be the target of CW Alarm?

A
  • Amazon EC2
  • EC2 Auto Scaling
  • Amazon SNS

Stop, Terminate or Recover EC2 instance.
Trigger auto scaling action
Send noti to SNS

26
Q

What are CW Compiste Alarms?

A
  • Composite Alarms are monitoring the states of multiple other alarms
  • AND and OR conditions
  • Helpful to reduce “alarm noise” by creating complex composite alarms
27
Q

How to test CW Alarms and Notifications by CLI?

A

aws cloudwatch set-alarm-state –alarm-name “myalarm” –state-value
ALARM –state-reason “testing purposes”