DVA-C02 Question 357
Select 3You are developing a serverless application using AWS Lambda that interacts with multiple AWS services. The application is experiencing intermittent performance issues, and you want to improve observability to identify the root cause. Which approach should you implement to enhance the observability of your Lambda function?
- A
Enable AWS X-Ray tracing in the Lambda function configuration and annotate traces with relevant metadata.
- B
Use Amazon CloudWatch Logs Insights to query and analyze logs generated by the Lambda function.
- C
Manually write custom metrics to Amazon CloudWatch using the AWS SDK for Python (Boto3).
- D
Enable detailed monitoring on the Lambda function to capture additional metrics at a one-second granularity.
- E
Integrate AWS Distro for OpenTelemetry (ADOT) to send traces and metrics to a third-party monitoring system.
Show answer and explanation
Correct answers: A, B, E
Explanation
To enhance observability for AWS Lambda applications, it is essential to use tools like AWS X-Ray for tracing, Amazon CloudWatch Logs for log analysis, and AWS Distro for OpenTelemetry for exporting telemetry data. These tools collectively help you monitor, debug, and optimize performance. Writing custom metrics manually or relying on unsupported options like detailed monitoring is not recommended or feasible for comprehensive observability.
- A. Correct.
Enabling AWS X-Ray tracing allows you to trace requests as they travel through the application and record metadata to help identify bottlenecks or errors. This is a recommended best practice for observability.
- B. Correct.
Amazon CloudWatch Logs Insights provides powerful querying and analysis capabilities for logs, allowing you to identify patterns and issues in your Lambda function's execution.
- C. Incorrect.
Manually writing custom metrics to CloudWatch is possible but is not an efficient or scalable approach to improving observability, especially in serverless architectures.
- D. Incorrect.
Detailed monitoring on Lambda is not supported. Lambda functions provide CloudWatch metrics at a one-minute granularity by default, and there is no option to enable one-second granularity metrics.
- E. Correct.
Integrating AWS Distro for OpenTelemetry (ADOT) allows you to collect and export telemetry data, such as traces and metrics, to third-party observability tools, enhancing observability further.