DVA-C02 Question 330
Select 2A development team is running a critical serverless application on AWS Lambda with an Amazon API Gateway front end. They want to ensure that they can monitor the performance of the Lambda functions and troubleshoot any errors effectively. Which combination of actions should they take to achieve this?
- A
Enable AWS X-Ray tracing for the API Gateway and Lambda functions.
- B
Use Amazon CloudTrail to log API Gateway requests and responses in real-time.
- C
Configure Amazon CloudWatch Logs for the Lambda functions to capture execution logs.
- D
Create custom CloudWatch metrics using the AWS SDK to monitor Lambda function performance.
- E
Enable detailed monitoring for Lambda functions in the AWS Management Console.
Show answer and explanation
Correct answers: A, C
Explanation
To effectively monitor and troubleshoot a serverless application using AWS Lambda and API Gateway, enabling AWS X-Ray provides distributed tracing to analyze performance and dependencies. Configuring Amazon CloudWatch Logs ensures that execution logs, including errors, are captured for debugging. These actions provide a comprehensive view of the application's performance and help identify issues quickly.
- A. Correct.
Enabling AWS X-Ray provides end-to-end tracing of requests across AWS services, including API Gateway and Lambda, which helps monitor performance and troubleshoot issues.
- B. Incorrect.
Amazon CloudTrail logs API calls and management events but does not provide real-time monitoring or detailed request/response logging for API Gateway.
- C. Correct.
Amazon CloudWatch Logs can be configured to capture logs from Lambda functions, such as execution details and error messages, which are crucial for troubleshooting.
- D. Incorrect.
While creating custom CloudWatch metrics can help monitor specific performance indicators, it is not a standard solution for logging or monitoring Lambda functions in this scenario.
- E. Incorrect.
Detailed monitoring is not an option for AWS Lambda. Lambda functions already publish detailed metrics to CloudWatch by default without the need for enabling additional monitoring.