How to find slow Lambda executions across all functions?

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?

  1. 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.
  2. 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.
  3. 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. Source Reference Answer
  4. 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.

Community Votes

C
70%
A
30%

70% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests knowledge of distributed tracing with AWS X-Ray versus log analysis with CloudWatch Logs Insights; the key is that X-Ray Insights on a group is purpose-built to surface slow Lambda executions across an entire application.

AWS X-Ray is the recommended service for tracing and identifying slow executions across multiple Lambda functions in a serverless application. CloudWatch Logs Insights can also analyze past executions, but X-Ray provides dedicated performance insights and grouping for distributed tracing.

Many candidates choose CloudWatch Logs Insights (Option A) because it can query historical logs and sort by duration, but it lacks the built-in distributed tracing and grouping capabilities of X-Ray that are specifically designed for this cross-function performance analysis scenario.

Community Discussion (8 comments)

monishvster 👍 6 Selected: C
X-ray will provide better insights for performance
ShakthiGCP 👍 1 Selected: C
X-Ray for performance
BrainFried 👍 2 Selected: A
I think the answer is A The goal is to analysis past executions of the Lambda functions, to isolate and identity the slow Lambda functions. This can be done with option A. Option D does not retroactively analyse past executions of Lambda functions - therefore it's not as effective as option A ~~
65703c1 👍 1 Selected: C
C is the correct answer.
KarBiswa 👍 4 Selected: C
https://docs.aws.amazon.com/lambda/latest/operatorguide/general-approach.html#:~:text=Use%20X%2DRay%20to%20find%20all%20the%20services%20involved%20in%20a%20request.%20For%20larger%20serverless%20applications%2C%20this%20is%20the%20fastest%20way%20to%20locate%20all%20of%20the%20interactions%20involved%20in%20the%20request.%20From%20X%2DRay%2C%20isolate%20the%20service%20where%20latency%20or%20errors%20are%20occurring%20then%20drill%20down%20further. It clearly an interaction issues among the services no failure has occurred
Abdullah22 👍 2 Selected: C
not sure between A and C but going with C.
SerialiDr 👍 2 Selected: A
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. Here's why this approach is most efficient: Centralized Logs: CloudWatch Logs Insights allows you to query logs across all your Lambda function log groups in a single location. Targeted Filtering: You can filter the query to focus on specific time periods of high traffic, pinpointing anomalies during those times. Sorting by Duration: By sorting the results descending by execution duration, you can easily identify Lambda functions with the slowest execution times. Fast Insights: CloudWatch Logs Insights offers near real-time analysis, enabling you to quickly identify performance bottlenecks.
CrescentShared 👍 2 Selected: A
Hesitate. A or C?

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

The correct answer is C. The scenario describes a serverless application with irregular slowness and no failed requests, which is a classic use case for AWS X-Ray. X-Ray provides distributed tracing that captures the end-to-end latency of requests as they flow through API Gateway, Lambda, and downstream services. By enabling X-Ray on all Lambda functions and creating an X-Ray insight on a group that includes all the functions, the developer can automatically surface anomalous latency patterns and identify the specific functions responsible for the slow executions.

Why Option A is less ideal: While Amazon CloudWatch Logs Insights (Option A) can query log groups and sort by execution duration, it requires manual query construction and does not provide the same level of integrated performance anomaly detection as X-Ray Insights. Logs Insights is better suited for ad-hoc log analysis rather than continuous performance monitoring across a distributed system.

Why Options B and D are incorrect: AWS CloudTrail Insights (Option B) is designed to detect unusual activity in API calls, not application performance issues like slow Lambda executions. AWS Glue (Option D) is an ETL service that would be overly complex and not purpose-built for real-time or near-real-time performance monitoring of Lambda functions. Using Glue to transform logs and then visualizing them in CloudWatch dashboards introduces unnecessary complexity and latency.

Official Reference

Exam Strategy

When the question mentions 'slow executions across all Lambda functions' in a serverless application with no failures, think distributed tracing first. AWS X-Ray is specifically designed for this scenario, while CloudWatch Logs Insights is better for log-based queries and CloudTrail is for API activity monitoring.

Related Analysis

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide