AWS Certified Developer – Associate / Question #925 of 557

Question #925

A developer built a distributed application using microservices deployed on Amazon EC2 instances. Due to high traffic, correlating logs across microservices for individual transactions has become challenging. The developer needs to trace request paths to identify bottlenecks.

Which two actions should the developer take to address this? (Choose two.)

A

Install the AWS X-Ray daemon on an EC2 instance, ensuring UDP port 2000 is open for outbound traffic.

B

Create a VPC endpoint for X-Ray to allow TCP traffic on port 2000 to the AWS managed daemon.

C

Integrate AWS CloudWatch Logs with X-Ray to automatically correlate log entries.

D

Incorporate the AWS X-Ray SDK into each microservice to trace and segment requests.

E

Configure Amazon Kinesis Data Firehose to stream metrics to X-Ray for analysis.

Explanation

To trace request paths in a distributed microservices application using AWS X-Ray, two critical steps are required:

1. Install the AWS X-Ray Daemon (A): The X-Ray daemon collects trace data from the application and forwards it to AWS X-Ray. It uses UDP port 2000 for outbound communication, which must be open on the EC2 instances.
2. Incorporate the X-Ray SDK (D): The SDK must be integrated into each microservice to instrument the code, generate trace segments, and send data to the X-Ray daemon.

Why other options are incorrect:
- B: X-Ray uses UDP port 2000, not TCP, and VPC endpoints for X-Ray use port 443.
- C: CloudWatch Logs integration requires manual configuration (e.g., adding trace IDs to logs) and is not automatic.
- E: X-Ray does not use Kinesis Data Firehose; data is sent via the X-Ray daemon.

Key Points:
- X-Ray requires the daemon (UDP 2000) and SDK integration for distributed tracing.
- Log correlation requires trace IDs in logs, which the SDK facilitates but does not automate with CloudWatch.

Answer

The correct answer is: AD