SOA-C02 Question 7
Select 3Your organization has a web application running on Amazon EC2 instances behind an Application Load Balancer (ALB). You need to monitor the health of the EC2 instances and ensure that you are alerted if there is a sudden spike in 5XX errors returned by the ALB. Which actions should you take to meet this requirement?
- A
Create an Amazon CloudWatch metric filter for 5XX errors and configure a CloudWatch alarm to trigger when the metric exceeds a threshold.
- B
Enable ALB access logging and use Amazon Athena to query the logs for 5XX error patterns.
- C
Use an AWS Lambda function to periodically check the ALB health status and send notifications if 5XX errors are detected.
- D
Enable ALB target group health checks and configure a CloudWatch alarm for unhealthy hosts.
- E
Create a CloudWatch alarm based on the ALB's built-in metric for HTTPCode_ELB_5XX_Count.
Show answer and explanation
Correct answers: A, D, E
Explanation
To monitor and alert on spikes in 5XX errors from the ALB, you can use CloudWatch metrics and alarms. The HTTPCode_ELB_5XX_Count metric is specifically designed for this purpose. Additionally, enabling target group health checks ensures EC2 instance health is monitored. While logging and querying can be useful for debugging, they are not suitable for real-time monitoring. Lambda functions are unnecessary when CloudWatch provides direct monitoring capabilities.
- A. Correct.
Correct: Creating a CloudWatch metric filter for 5XX errors and setting up an alarm helps monitor for spikes in these errors and ensures you are alerted.
- B. Incorrect.
Incorrect: While enabling ALB access logging and querying logs can provide insights, it is not designed for real-time alerting and monitoring.
- C. Incorrect.
Incorrect: Lambda functions are not required for monitoring ALB metrics because CloudWatch provides this functionality natively.
- D. Correct.
Correct: Configuring health checks on the ALB target group and setting up a CloudWatch alarm for unhealthy hosts ensures the health of the EC2 instances is monitored.
- E. Correct.
Correct: The built-in CloudWatch metric HTTPCode_ELB_5XX_Count provides direct insights into 5XX errors from the ALB, which can be used to configure alarms.