AWS Certified Developer – Associate / Question #933 of 557

Question #933

A company built a serverless application on AWS using Amazon API Gateway, AWS Lambda, and Amazon DynamoDB. Users are reporting intermittent latency issues during peak usage times. The development team needs to trace full request flows across all services to pinpoint performance degradation sources with minimal code changes.

Which approach provides the MOST comprehensive visibility into service dependencies and latency bottlenecks while requiring the LEAST implementation effort?

A

Enable AWS X-Ray integration for API Gateway and Lambda. Analyze traces and service maps to identify latency hotspots.

B

Implement custom metrics in Lambda functions using CloudWatch Embedded Metric Format. Create dashboards to monitor function execution times.

C

Configure API Gateway to publish latency metrics to CloudWatch. Set alarms for high latency values in the integration responses.

D

Enable DynamoDB Contributor Insights and monitor throttling events using CloudWatch metrics for consumed read/write capacity.

Explanation

Answer A is correct because AWS X-Ray is specifically designed to trace requests across distributed services like API Gateway, Lambda, and DynamoDB. Enabling X-Ray integration requires minimal configuration (e.g., adding IAM permissions and enabling tracing in API Gateway/Lambda) and automatically captures latency data across all services. The service map visualizes dependencies and highlights latency hotspots (e.g., slow DynamoDB queries or Lambda cold starts).

Other options are incorrect because:
- B: Custom CloudWatch metrics require code changes and only track Lambda execution times, not API Gateway or DynamoDB.
- C: API Gateway latency metrics only cover integration responses, not Lambda/DynamoDB bottlenecks.
- D: DynamoDB Contributor Insights focuses on throttling events, not end-to-end latency tracing.

Key Points:
1. X-Ray provides cross-service tracing with minimal effort.
2. Service maps help visualize dependencies and latency.
3. Other options lack full coverage or require more code changes.

Answer

The correct answer is: A