How to enable AWS X-Ray tracing for EC2 microservices?
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.)
Community Votes
100% of anonymous learners picked answer AD. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the specific architecture of AWS X-Ray on EC2, requiring both the SDK for instrumentation and the Daemon for data relay, which differs from managed services like Lambda.
To analyze message flow and correlate logs in distributed EC2 microservices, developers must implement AWS X-Ray. This requires installing the X-Ray daemon on the EC2 instances and integrating the X-Ray SDK into the application code.
Selecting option C is a common error because users often confuse CloudWatch Logs integration with the core mechanism of X-Ray tracing, which relies on the SDK and Daemon rather than log pushing.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option D is correct because adding the AWS X-Ray SDK to the microservices is the primary method to instrument the application code, allowing it to send trace data segments for incoming and outgoing requests. Option A is correct because the X-Ray daemon must be installed on EC2 instances to listen for this trace data on UDP port 2000 and relay it to the AWS X-Ray API, which is necessary since EC2 does not provide a managed runtime environment like AWS Lambda does. Together, these steps create a service map that visualizes the message flow and correlates specific transactions across microservices.Why the Other Options Are Wrong
Option B is incorrect because the X-Ray daemon communicates with the AWS X-Ray service over HTTPS (TCP 443), not TCP 2000, and while VPC endpoints can be used, the description of a "global daemon" on TCP 2000 is technically inaccurate regarding the daemon's role. Option C is incorrect because CloudWatch does not push logs to X-Ray to generate traces; traces are generated by the SDK, though logs can be linked manually via Trace IDs. Option E is incorrect because CloudWatch metric streams deal with metric data aggregation, not the specific transaction tracing or message flow analysis required for debugging distributed systems.Community Comment Notes
Community comments strongly support the combination of A and D, highlighting the specific role of the daemon in gathering raw segment data and the SDK's role in instrumentation. Commenters emphasize that the daemon listens on UDP port 2000 locally, reinforcing the validity of option A and clarifying the communication flow between the application, the daemon, and the cloud service.Official Reference
Exam Strategy
When asked about tracing on EC2, remember the "SDK + Daemon" pattern. Unlike Lambda or ECS, which have managed integrations, EC2 requires you to manually install the daemon to handle the communication to the X-Ray backend.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →