A company is running a critical web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The DevOps team wants to monitor HTTP 5xx errors and receive alerts when the error rate exceeds 5% over a 5-minute period. Which combination of services and configurations should be used to meet these requirements?
Trap 1: Enable CloudWatch Logs for the ALB and use CloudWatch Logs Insights…
Incorrect: This is possible but not the simplest or most direct method; the ALB already provides 5xx metrics.
Trap 2: Configure AWS Config rules to check ALB 5xx error counts and…
Incorrect: AWS Config is for configuration compliance, not real-time error monitoring.
Trap 3: Use AWS X-Ray to trace requests and create a CloudWatch alarm based…
Incorrect: X-Ray is for tracing, not for aggregate error rate monitoring.
- A
Enable CloudWatch Logs for the ALB and use CloudWatch Logs Insights to query 5xx logs, then create a metric filter and alarm.
Why wrong: Incorrect: This is possible but not the simplest or most direct method; the ALB already provides 5xx metrics.
- B
Configure AWS Config rules to check ALB 5xx error counts and trigger alarms.
Why wrong: Incorrect: AWS Config is for configuration compliance, not real-time error monitoring.
- C
Use CloudWatch ALB metrics (HTTPCode_ELB_5XX_Count) and create a CloudWatch Alarm on the Sum statistic with a threshold based on total request count.
Correct: ALB publishes HTTP 5xx metrics to CloudWatch, and alarms can be set on these metrics.
- D
Use AWS X-Ray to trace requests and create a CloudWatch alarm based on X-Ray error rate.
Why wrong: Incorrect: X-Ray is for tracing, not for aggregate error rate monitoring.