DOP-C02 Practice Question 68: CloudWatch Embedded Metric Format
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 7 · question 8 of 10
A team's application already writes structured JSON log entries to CloudWatch Logs for every request, including latency and business fields. The team wants CloudWatch to automatically turn selected fields from those log entries into custom CloudWatch metrics that can be graphed and alarmed on, without adding extra PutMetricData API calls from the application and without standing up a separate metrics pipeline. What should the team do?
Show answer and explanation
Answer:
Embedded metric format (EMF) is a JSON log specification where the log entry itself carries a metadata block naming which fields to treat as metrics, their units, and their dimensions. CloudWatch Logs automatically extracts those values into standard CloudWatch metrics on ingestion, with no separate PutMetricData calls and no extra pipeline, exactly matching the requirement. Option A works but reintroduces the PutMetricData calls and the operational overhead of a Lambda function the team wanted to avoid. Option B is unnecessary extra infrastructure since the application already logs to CloudWatch Logs directly; the unified agent is meant for hosts that are not already sending logs. Option C, a metric filter per field, can extract simple counts or values from log patterns, but it does not support attaching custom dimensions and units as naturally as EMF and requires managing one filter per metric rather than one log format.
Reference: Embedding metrics within logs