AWS Certified Developer – Associate (DVA-C02) — Question 377
A developer has written a distributed application that uses microservices. The microservices are running on Amazon EC2 instances. Because of message volume, the developer is unable to match log output from each microservice to a specific transaction. The developer needs to analyze the message flow to debug the application.
Which combination of steps should the developer take to meet this requirement? (Choose two.)
Answer options
- A. Download the AWS X-Ray daemon. Install the daemon on an EC2 instance. Ensure that the EC2 instance allows UDP traffic on port 2000.
- B. Configure an interface VPC endpoint to allow traffic to reach the global AWS X-Ray daemon on TCP port 2000.
- C. Enable AWS X-Ray. Configure Amazon CloudWatch to push logs to X-Ray.
- D. Add the AWS X-Ray software development kit (SDK) to the microservices. Use X-Ray to trace requests that each microservice makes.
- E. Set up Amazon CloudWatch metric streams to collect streaming data from the microservices.
Correct answer: A, D
Explanation
To enable request tracing across microservices using AWS X-Ray, the application code must be instrumented using the AWS X-Ray SDK (Option D) to generate and propagate correlation IDs. Additionally, the AWS X-Ray daemon must be installed on the EC2 instances to collect segment data and send it to the X-Ray service, which requires UDP port 2000 to be open (Option A). Other options, like using CloudWatch logs/metrics directly or TCP port 2000, do not support X-Ray's daemon protocol or trace generation requirements.