AWS Certified Developer – Associate (DVA-C02) — Question 474
A developer created several AWS Lambda functions that write data to a single Amazon S3 bucket. The developer configured all the Lambda functions to send logs and metrics to Amazon CloudWatch.
The developer receives reports that one of the Lambda functions writes data to the bucket very slowly. The developer needs to measure the latency between the problematic Lambda function and the S3 bucket.
Which solution will meet this requirement?
Answer options
- A. Enable AWS X-Ray on the Lambda function. In the generated trace map, select the line between Lambda and Amazon S3.
- B. Query the Lambda function’s log file in Amazon CloudWatch Logs Insights. Return the average of the auto-discovered @duration field.
- C. Enable CloudWatch Lambda Insights on the function. View the latency graph that CloudWatch Lambda Insights provides.
- D. Enable AWS X-Ray on the Lambda function. Select Amazon S3 in the latency graph to view the latency histogram.
Correct answer: A
Explanation
AWS X-Ray allows developers to trace requests as they travel through downstream services like Amazon S3. By enabling AWS X-Ray on the Lambda function and viewing the generated service map (trace map), the developer can select the edge (line) connecting the Lambda function to Amazon S3 to inspect the latency metrics specific to that connection. Querying the @duration field in CloudWatch Logs Insights only provides the total execution time of the Lambda function rather than the specific duration of the call to S3, and CloudWatch Lambda Insights does not natively show individual downstream call latencies.