An application writes structured JSON logs to CloudWatch Logs. Developers want to embed custom metric definitions in those events so CloudWatch extracts metrics without separate PutMetricData calls. What should they use?
Show the answer
Correct answerD. CloudWatch embedded metric format
AWhy not this: Trace annotations support filtering traces, not extracting CloudWatch metrics from JSON log events.
BWhy not this: Subscription filters route log events to destinations; they do not define embedded custom metrics.
CWhy not this: Metric filters use log-group extraction rules rather than metric definitions embedded in events.
DWhy this is right: Embedded metric format lets CloudWatch extract custom metrics from structured log events containing metric metadata.
CloudWatch embedded metric format embeds metric definitions and values in structured log events for automatic extraction. Metric filters instead define matching and extraction rules on a log group rather than embedding metric definitions in each event.