AWS Certified Developer Associate DVA-C02 Practice Question
A developer needs to programmatically publish a single data point for a custom metric to Amazon CloudWatch from an AWS Lambda function. The metric, named 'ImagesProcessed', will be in a custom namespace. What is the most direct method to publish this metric from within the Lambda function's code?
Write the metric as a structured JSON log message to standard output so that a CloudWatch Logs metric filter can extract it.
Store the metric count in an Amazon DynamoDB table and then have CloudWatch read the metric from the table.
Send the metric data to an Amazon SQS queue for a separate monitoring service to process and forward to CloudWatch.
Call the putMetricData operation using the CloudWatch client, providing the metric namespace, name, and value.
The most direct way to publish a custom metric data point using an AWS SDK, including from within a Lambda function, is to use the putMetricData API call. This action allows the code to directly send a metric with a specified namespace, name, dimensions, and value to CloudWatch. While creating metrics from logs using metric filters or the Embedded Metric Format (EMF) is a valid and often recommended pattern, it is less direct than a specific API call designed for publishing metrics. Using intermediate services like Amazon SQS or Amazon DynamoDB adds unnecessary complexity and latency for this requirement.
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 the `putMetricData` operation in CloudWatch?
Open an interactive chat with Bash
Why should a custom metric be sent to CloudWatch using the `putMetricData` API instead of other methods?
Open an interactive chat with Bash
How does a namespace in CloudWatch help when sending custom metrics?
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...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .