0
0
AWScloud~20 mins

CloudWatch metrics in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CloudWatch Metrics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Understanding CloudWatch Metric Retention Periods

CloudWatch stores metrics with different retention periods depending on the granularity. Which of the following correctly describes the retention period for 1-minute metrics?

A1-minute metrics are retained for 15 days.
B1-minute metrics are retained for 455 days.
C1-minute metrics are retained for 63 days.
D1-minute metrics are retained indefinitely.
Attempts:
2 left
💡 Hint

Think about how CloudWatch stores detailed metrics before aggregating them.

Architecture
intermediate
2:00remaining
Choosing Metric Granularity for Cost and Detail

You want to monitor an application with detailed metrics but keep CloudWatch costs low. Which metric granularity should you choose to balance detail and cost?

AUse 1-second custom metrics for all data points.
BUse 1-minute standard metrics for most data points.
CUse 5-minute standard metrics for all data points.
DUse 1-hour aggregated metrics only.
Attempts:
2 left
💡 Hint

Consider the default granularity and cost implications.

security
advanced
2:30remaining
Securing CloudWatch Metrics Access

You want to restrict access so that a user can only view CloudWatch metrics for a specific EC2 instance. Which IAM policy condition correctly enforces this?

AWS
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["cloudwatch:GetMetricData"],
    "Resource": "*",
    "Condition": {
      "StringEquals": {
        "cloudwatch:dimension_InstanceId": "i-1234567890abcdef0"
      }
    }
  }]
}
AUse a condition with "ec2:InstanceId" matching the EC2 instance ID.
BUse a resource ARN restricting to the EC2 instance ARN.
CUse a condition with "cloudwatch:Namespace" set to "AWS/EC2".
DUse a condition with "cloudwatch:dimension_InstanceId" matching the EC2 instance ID.
Attempts:
2 left
💡 Hint

CloudWatch metrics can be filtered by dimensions in IAM conditions.

Configuration
advanced
2:30remaining
Configuring Custom Metrics with Dimensions

You want to publish a custom metric to CloudWatch with two dimensions: "ServiceName" and "Environment". Which of the following JSON payloads correctly represents this metric data?

A{ "MetricName": "RequestCount", "Dimensions": [{"Name": "ServiceName", "Value": "Auth"}, {"Name": "Environment", "Value": "Prod"}], "Value": 100 }
B{ "MetricName": "RequestCount", "Dimension": [{"Name": "ServiceName", "Value": "Auth"}, {"Name": "Environment", "Value": "Prod"}], "Value": 100 }
C{ "MetricName": "RequestCount", "Dimensions": {"ServiceName": "Auth", "Environment": "Prod"}, "Value": 100 }
D{ "MetricName": "RequestCount", "Dimensions": [{"ServiceName": "Auth"}, {"Environment": "Prod"}], "Value": 100 }
Attempts:
2 left
💡 Hint

Check the correct key names and structure for dimensions in CloudWatch metric data.

🧠 Conceptual
expert
3:00remaining
Interpreting CloudWatch Metric Math Output

You have two CloudWatch metrics: CPUUtilization and NetworkIn. You create a metric math expression: CPUUtilization / NetworkIn. If NetworkIn is zero at some points, what will be the output of the expression at those points?

AThe output will be null (no data) for those points.
BThe output will be infinity (∞) for those points.
CThe output will be zero to avoid division errors.
DThe output will cause the entire metric math query to fail.
Attempts:
2 left
💡 Hint

Think about how CloudWatch handles division by zero in metric math.