AWS Certified Developer – Associate (DVA-C02) — Question 319
A company runs an application on AWS. The application consists of a static website that is hosted on Amazon S3. The application includes Amazon API Gateway APIs that invoke AWS Lambda functions. During a period of high traffic on the application, application users reported that the application was slow at irregular intervals. There were no failed requests.
A developer needs to find the slow executions across all the Lambda functions.
Which solution will meet these requirements?
Answer options
- A. Perform a query across all the Lambda function log groups by using Amazon CloudWatch Logs Insights. Filter on type of report and sort descending by Lambda function execution duration.
- B. Enable AWS CloudTrail Insights on the account where the Lambda functions are running. After CloudTrail Insights has finished processing, review CloudTrail Insights to find the anomalous functions.
- C. Enable AWS X-Ray for all the Lambda functions. Configure an X-Ray insight on a new group that includes all the Lambda functions. After the X-Ray insight has finished processing, review the X-Ray logs.
- D. Set up AWS Glue to crawl through the logs in Amazon CloudWatch Logs for the Lambda functions. Configure an AWS Glue job to transform the logs into a structured format and to output the logs into Amazon S3. Use the Amazon CloudWatch dashboard to visualize the slowest functions based on the duration.
Correct answer: C
Explanation
AWS X-Ray is specifically designed to analyze and debug distributed applications, allowing developers to identify performance bottlenecks and trace requests across AWS Lambda functions. By enabling X-Ray and configuring X-Ray insights on a group of these functions, developers can automatically detect anomalies in execution times and review the associated traces. Other options, such as AWS CloudTrail Insights or AWS Glue, are either not designed for application latency tracing or introduce unnecessary complexity compared to native X-Ray capabilities.