Question #736
A developer is working on a Java application that runs on Amazon EC2 instances. The developer needs to trace distributed requests to identify latency issues in the application.
Which combination of actions should the developer take to achieve this goal? (Choose two.)
Install the Amazon CloudWatch agent on the EC2 instances.
Install the AWS X-Ray daemon on the EC2 instances.
Configure the application to write JSON-formatted logs to /var/log/CloudWatch.
Configure the application to write trace data to /var/log/X-Ray.
Install and configure the AWS X-Ray SDK for Java in the application.
Explanation
The correct answers are B and E. AWS X-Ray is designed for tracing distributed requests. Installing the X-Ray daemon (B) allows the EC2 instances to relay trace data to AWS X-Ray. Configuring the X-Ray SDK for Java (E) instruments the application to generate trace data.
Other options are incorrect: CloudWatch (A/C) handles metrics/logs but not distributed tracing. Writing trace data to a directory (D) is unnecessary as the X-Ray SDK sends data directly to the daemon. Key points: Use X-Ray SDK for instrumentation and X-Ray daemon for data collection.
Answer
The correct answer is: BE