DVA-C02 practice question · Development with AWS Services
A Lambda function needs to publish a custom CloudWatch metric, such as "OrdersProcessed", from within its handler code.
A Lambda function needs to publish a custom CloudWatch metric, such as "OrdersProcessed", from within its handler code. Which SDK call is used for this?
- ACloudWatch's PutMetricData API
- BDynamoDB's PutItem API
- CS3's PutObject API
- DSNS's Publish API
Show the answer and explanation
Correct answer: A) CloudWatch's PutMetricData API
Why each option is right or wrong
- A) Correct. PutMetricData is the CloudWatch API used to publish custom application metrics, letting a function record values like a counter or measurement under a custom namespace for later graphing and alarming.
- B) Incorrect. PutItem writes data to a DynamoDB table; it doesn't publish a value to CloudWatch as a metric.
- C) Incorrect. PutObject uploads an object to S3; it isn't the mechanism for publishing a CloudWatch custom metric.
- D) Incorrect. SNS Publish sends a message to a topic's subscribers; it doesn't record a value as a CloudWatch metric.
- Exam domain
- Development with AWS Services · 32% of DVA-C02
- Question type
- Multiple choice (one answer)
Related DVA-C02 questions
- A team wants to add cross-cutting functionality to their Lambda functions — like sending telemetry to a third-party…Development with AWS Services
- A developer wants a Step Functions state machine to run several independent branches of work — like calling three…Development with AWS Services
- A team needs to apply the same operation (such as copying or tagging) to millions of existing objects already in an S3…Development with AWS Services
- After deploying an update to a static asset in S3, users behind CloudFront continue seeing the old cached version until…Development with AWS Services
All 67 free DVA-C02 questions by domain · 15 sample questions on one page
Practise the full DVA-C02 exam
This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.
Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.