AWS Developer DVA-C02 · Troubleshooting and Optimization · easy

A developer wants their AWS Lambda function to emit custom business metrics (OrderValue, CheckoutLatencyMs) alongside high-cardinality dimensions (PaymentProvider, Region) into Amazon CloudWatch without making synchronous cloudwatch:PutMetricData network API calls that add latency and cost to every invocation. Which native CloudWatch feature lets Lambda write a specially structured JSON log line to stdout (CloudWatch Logs) so CloudWatch automatically extracts the custom metrics asynchronously?

Published · Last updated · checked before publication — how we verify questions

Options

  • AAWS CloudTrail Management Events log file integrity validation (SHA-256)
  • BAmazon S3 Server Access Logging delivered to an S3 Glacier archive vault
  • CAWS Config conformance packs evaluating IAM password policies
  • DCloudWatch Embedded Metric Format (EMF) JSON written to CloudWatch LogsCorrect answer

Answer: D. CloudWatch Embedded Metric Format (EMF) JSON written to CloudWatch Logs

CloudWatch Embedded Metric Format (EMF) allows Lambda functions (and containers/EC2) to print structured JSON log events containing an _aws metadata header to standard output (CloudWatch Logs). CloudWatch automatically parses those log lines and extracts the custom metrics without requiring PutMetricData API calls.

Why the other options are wrong

  • A. AWS CloudTrail Management Events log file integrity validation (SHA-256) — CloudTrail logs AWS control-plane API calls, not custom application metrics from stdout.
  • B. Amazon S3 Server Access Logging delivered to an S3 Glacier archive vault — S3 access logs record storage HTTP requests and do not publish CloudWatch custom metrics.
  • C. AWS Config conformance packs evaluating IAM password policies — AWS Config audits resource configuration compliance, not high-frequency Lambda metrics.

All Troubleshooting and Optimization questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.