AWS Certified Developer Associate DVA-C02 Practice Question
A development team is working on an AWS Lambda function designed to process incoming image files from an Amazon S3 bucket. The team wants to track the number of images processed per minute as a custom metric. Which code implementation will effectively allow the team to send this custom metric to Amazon CloudWatch?
The Lambda function should use an Amazon Kinesis stream to capture the count of processed images, and then CloudWatch collects the metric from the stream.
The Lambda function should call the putMetricData operation of the CloudWatch client with a namespace and metric data for images processed each minute.
The Lambda function should store the count of images processed in an Amazon DynamoDB table, which acts as a custom metric data source for CloudWatch.
The Lambda function should write the count of processed images to the application logs, and CloudWatch parses the logs to extract the metric.
To emit a custom metric to Amazon CloudWatch from an AWS Lambda function, developers must use the PutMetricData API action provided by the Amazon CloudWatch service. When using AWS SDK for this action, they should create a metric data query structure that includes the namespace, metric name, value, and a timestamp. The putMetricData operation will then publish the custom metric to CloudWatch. Note that other answers involve incorrect methods that do not align with how CloudWatch custom metrics should be emitted from a Lambda function.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Amazon CloudWatch and how does it work?
Open an interactive chat with Bash
What is the PutMetricData API action in AWS CloudWatch?
Open an interactive chat with Bash
What are the differences between CloudWatch metrics and logs?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Troubleshooting and Optimization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access