AWS Certified Developer Associate DVA-C01 – Question262

A company has an AWS Lambda function that runs hourly, reads log files that are stored in Amazon S3, and forwards alerts to Amazon Simple Notification Service (Amazon SNS) topics based on content. A developer wants to add a custom metric to the Lambda function to track the number of alerts of each type for each run.
The developer needs to log this information in Amazon CloudWatch in a metric that is named Lambda/AlertCounts.
How should the developer modify the Lambda function to meet this requirement with the LEAST operational overhead?

A.
Add a print statement to standard out for each alert and the number of occurrences.
B. Add a call to the PutMetricData API operation. Pass an array for alerts and the number of occurrences in the Values and Counts fields with a namespace of "Lambda/AlertCounts".
C. Add a call to the PutMetricAlarm API operation. Pass an array of alerts in the metrics member with the namespace of "Lambda/AlertCounts".
D. Add a call to the PutDashboard API operation. Pass an array of alerts in the metrics member with the namespace of "Lambda/AlertCounts".

Correct Answer: C