A new serverless user portal is performing slowly. Analysis shows a single API Gateway endpoint calling a Lambda function is responsible, but that Lambda calls other APIs and AWS services. Using operational best practices, how can a developer find which external call is causing the increased latency?
Choose an answer
Tap an option to check your answer.
Correct answer: Instrument the Lambda with the AWS X-Ray SDK, add HTTP/HTTPS interceptors and SDK client handlers, enable X-Ray tracing, deploy, then use the X-Ray service map and traces to find average response times and the likely slow components..
Why this is the answer
AWS X-Ray is designed for distributed tracing, making it the most effective tool for identifying latency issues across multiple services. By instrumenting the Lambda function with the X-Ray SDK and enabling tracing, developers can visualize the entire request flow, including calls to other APIs and AWS services. The X-Ray service map and traces provide detailed timing information for each segment, allowing for precise identification of the slowest components. Adding logging statements (first option) is a manual and less efficient approach. While it can provide some insight, it requires careful parsing of logs and doesn't offer the visual correlation and detailed breakdown that X-Ray provides. CloudWatch metrics (third option) show overall Lambda performance but don't pinpoint which specific external call within the Lambda is causing the bottleneck. CloudWatch Synthetics (fourth option) is for monitoring end-to-end user experience and proactively detecting issues, not for deep-diving into the internal execution of a specific Lambda function to find a slow external call.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed