AWS Certified Developer – Associate (DVA-C02) — Question 22

A company is building a serverless application on AWS. The application uses an AWS Lambda function to process customer orders 24 hours a day, 7 days a week. The Lambda function calls an external vendor's HTTP API to process payments.
During load tests, a developer discovers that the external vendor payment processing API occasionally times out and returns errors. The company expects that some payment processing API calls will return errors.
The company wants the support team to receive notifications in near real time only when the payment processing external API error rate exceed 5% of the total number of transactions in an hour. Developers need to use an existing Amazon Simple Notification Service (Amazon SNS) topic that is configured to notify the support team.
Which solution will meet these requirements?

Answer options

Correct answer: B

Explanation

Option B is correct because it allows for the tracking of payment processing API failures through custom metrics, and setting a CloudWatch alarm enables real-time notifications when the error rate exceeds 5%. Option A relies on querying logs, which is less efficient for real-time notifications. Option C does not provide a mechanism for tracking error rates, and Option D introduces unnecessary complexity by using S3 and Athena instead of directly monitoring API call failures with CloudWatch.