StudyToCert

All certifications / Developer Associate / Lessons

AWS Certified Developer – Associate DVA-C02 · Domain 4: Troubleshooting and Optimization

Custom metrics: PutMetricData, CloudWatch embedded metric format, high-resolution metrics

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

AWS automatically measures things about its own services, like how many times a function ran. But it does not know about your business, such as how many books you sold. Custom metrics let you send your own numbers to Amazon CloudWatch, the AWS monitoring service, so you can draw graphs and set alarms on them. There are two main ways. You can call an API that says "here is a number", which is direct but adds a little waiting time to your code. Or you can write a specially formatted line into your logs, and CloudWatch reads the number out of it for you later. Think of it like either phoning in your sales count or writing it in a logbook that someone collects. You can also ask for second-by-second detail instead of minute-by-minute when speed matters.

The finance team at Cedar Lane Books wants a dashboard by Friday showing orders placed per minute and how long the payment partner takes to answer. You open CloudWatch and find hundreds of metrics: Lambda invocations, DynamoDB consumed capacity, API Gateway latency. None of them say "orders". A teammate, Jonah, has already tried calling the metrics API on every order, and the checkout function got noticeably slower during last weekend's sale. Meanwhile the operations lead wants an alarm that reacts within seconds, not minutes, when payment failures spike. How do you get your own numbers into CloudWatch without slowing checkout down?

AWS services publish many metrics automatically, but none of them describe your business events: orders placed, payments declined, items in a cart, or time spent calling a partner API. Custom metrics let you publish those numbers to Amazon CloudWatch so you can graph them, put them on dashboards and alarm on them exactly like built-in metrics. The exam expects you to know how a metric is identified, the two ways to publish (the PutMetricData API and the embedded metric format), and when high-resolution metrics are worth it.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study Developer Associate for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Developer Associate study plan