DVA-C02 Question 363
Select 3You are developing a microservices-based application running on Amazon ECS with AWS Fargate. The application involves multiple services communicating with each other via HTTP. You want to implement distributed tracing to monitor and troubleshoot issues across these services. Which combination of actions should you take to achieve this?
- A
Instrument your application code with the AWS X-Ray SDK to send trace data for each service.
- B
Enable AWS X-Ray tracing in the ECS task definition for each service.
- C
Use Amazon CloudWatch Logs Insights to query trace data directly without the need for AWS X-Ray.
- D
Add an IAM policy granting permissions to write trace data to X-Ray for your ECS task role.
- E
Deploy an X-Ray daemon container alongside your application containers in each ECS task.
Show answer and explanation
Correct answers: A, D, E
Explanation
To implement distributed tracing using AWS X-Ray in a microservices environment on Amazon ECS with Fargate, you need to instrument your application with the X-Ray SDK to generate trace data. Additionally, you must deploy the X-Ray daemon container in each ECS task to send trace data to X-Ray. The ECS task role must also have permissions to write trace data, ensuring proper functionality. Enabling tracing in the ECS task definition is not applicable, and CloudWatch Logs Insights is unrelated to distributed tracing.
- A. Correct.
Correct. Instrumenting your application with the AWS X-Ray SDK is necessary to generate trace data for your services.
- B. Incorrect.
Incorrect. While X-Ray integration can be enabled in certain compute services like AWS Lambda, for ECS tasks, you need to deploy an X-Ray daemon container instead.
- C. Incorrect.
Incorrect. Amazon CloudWatch Logs Insights is a useful tool for log analysis but does not directly support distributed tracing or trace data querying without X-Ray.
- D. Correct.
Correct. The ECS task role must have permissions to write trace data to AWS X-Ray for the distributed tracing to work properly.
- E. Correct.
Correct. The X-Ray daemon container is responsible for collecting trace data from the services and sending it to AWS X-Ray.