AWS Certified Developer – Associate — Question 364
A developer is building a new complex application on AWS. The application consists of multiple microservices hosted on Amazon EC2. The developer wants to determine which microservice adds the most latency while handling a request.
Which method should the developer use to make this determination?
Answer options
- A. Instrument each microservice request using the AWS X-Ray SDK. Examine the annotations associated with the requests.
- B. Instrument each microservice request using the AWS X-Ray SDK. Examine the subsegments associated with the requests.
- C. Instrument each microservice request using the AWS X-Ray SDK. Examine the Amazon CloudWatch EC2 instance metrics associated with the requests.
- D. Instrument each microservice request using the Amazon CloudWatch SDK. Examine the CloudWatch EC2 instance metrics associated with the requests.
Correct answer: B
Explanation
AWS X-Ray is designed to trace and analyze latency in distributed applications like microservices. By instrumenting the application with the AWS X-Ray SDK, developers can inspect subsegments, which provide detailed breakdown timing data for downstream calls and internal steps of a request. Annotations are metadata used for filtering traces rather than measuring latency, and CloudWatch EC2 metrics do not provide request-level trace latency details.