Skip to main content

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)

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.