SOA-C02 Practice Question: ALB access logs for diagnosing 502 errors without…
Users are intermittently reporting 502 Bad Gateway errors when accessing the application through an Application Load Balancer. The team needs to identify which target IPs are associated with the failures and the request processing time for those requests. Application logs on instances do not capture failures before the ALB connection. What should be enabled?
⚠ Common exam trap
Test-takers frequently confuse ALB access logs with VPC Flow Logs or X-Ray, assuming any logging mechanism that captures network traffic or traces will include HTTP-level details like status codes and request processing times, but only ALB access logs provide the specific fields needed to correlate 502 errors with target IPs and timing.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable ALB access logs, specify an S3 bucket destination, and query the logs to filter on elb_status_code=502
ALB access logs capture detailed information about each request, including the target IP address, request processing time, and the HTTP status code returned by the ALB. By enabling these logs and querying for `elb_status_code=502`, you can identify which target IPs were associated with the failures and the `request_processing_time` for those requests. This directly addresses the need to correlate failures with specific targets and timing, without relying on application instance logs that miss pre-connection failures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Enable ALB access logs, specify an S3 bucket destination, and query the logs to filter on elb_status_code=502
Why this is correct
Access logs capture every ALB request including 502s. Each log entry contains the target_ip:target_port field identifying which instance handled (or failed to handle) the request, and request_processing_time and target_processing_time values for performance analysis. This data is available without any changes to instance-side software.
- ✗
Enable AWS X-Ray on the ALB to trace each request end-to-end from client to target
Why it's wrong here
AWS X-Ray traces application-level requests but requires SDK instrumentation in the application code to produce meaningful traces. X-Ray does not trace at the ALB level — it traces within the application running on the target. If the application is not instrumented and X-Ray is not enabled on the ALB (which requires Application Load Balancer with X-Ray sampling, a separate feature), no traces are produced at the load balancer layer.
- ✗
Configure a VPC Flow Log on the subnets containing the ALB to capture all network traffic
Why it's wrong here
VPC Flow Logs record IP-level packet metadata (source IP, destination IP, port, protocol, bytes, packets, action). They do not record HTTP-level details like status codes, HTTP methods, URLs, or processing times. Diagnosing 502s requires HTTP-level data, which only ALB access logs provide.
- ✗
Install an agent on the application instances that logs all incoming connection attempts from the ALB
Why it's wrong here
502 errors from the ALB often occur because the target closed the connection, rejected it, or did not respond before the idle timeout. In many 502 cases, the instance-side agent would not log anything — the connection failure happens before or without the application receiving the request.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This SOA-C02 question is part of Courseiva's 1,169-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.