CloudWatch Flashcards
How would you view EC2 memory usage as a metric?
Push the metric from inside the instance as a custom metric (not pushed by default).
How do you create a custom metric, and what resolutions can you have?
Use the API call PutMetricData with StorageResolution param
- Standard resolution: 1 minute
- High resolution: 1/5/10/30 second(s), higher cost
Can you insert your metric data points at any time?
No, but you can insert metric data points up to two weeks in the past, and two hours in the future (make sure to configure your EC2 instance time correctly).
What do you need to do to allow your EC2 machine to push logs to CloudWatch?
Run CloudWatch Logs/Unified Agent on that EC2 instance.
What is the difference between CloudWatch Logs Agent and CloudWatch Unified Agent?
Logs:
- Can only send to CloudWatch Logs
Unified:
- Collect addition system-level metrics such as RAM, processes, etc.
- Send logs to CloudWatch logs
- Centralized configuration using SSM Parameter Store
How can you easily test a CloudWatch alarm?
Use the CLI to set the alarm state to ALARM.
Give a high level description of CloudWatch Synthetics Canary.
Allows you to use a configurable script that monitors your APIs, URLs, Websites etc.
- Checks availability and latency of endpoints, and can store load time data and screenshots of the UI
How do EventBridge and the Schema Registry work together?
EventBridge can analyze the events in your bus and infer the schema
- Allows you to generate code for your application that will know in advance how data is structured in the event bus.
What is the difference between EventBridge and CloudWatch Events?
Same underlying service infrastructure (API and endpoint), but EventBridge allows:
- Extension to add event buses for custom applications and third-party SaaS apps
- Schema Registry
Describe a use case for a multi region resource policy on an event bus?
Aggregate all events from your AWS organization into a single AWS account or region (e.g., into a ‘central event bus’)
How do you enable AWS X-Ray on an instance?
Install the xray daemon - works as a low level UDP packet interceptor
- Each application must also have th eIAM rights to write data to xray.
How do you enable AWS X-Ray on Lambda?
- Ensure it has an IAM execution role with proper policy (AWSX-RAYWriteOnlyAccess)
- Ensure xray is imported in the code
- Enable Lambda xray Active Tracing
What is the difference between annotations and metadata in XRay?
Annotations - Key Value pairs used to index traces and use with filters
Metadata - Key Value pairs, not indexed, not used for searching
What rules can you specify for XRay sampling?
The reservoir and rate:
Reservoir - by default, one request per second is recorded each second as long as the service is serving requests
Rate - by default, 5 percent is the rate at which additional requests beyond the reservoir size are sampled
Why are the GetSamplingRules and other sampling requests found within the Write API?
The X-Ray daemon will poll for these rules and write them to the instance