Course menuDOP-C02

Exams / DOP-C02 / CloudWatch agent and metric streams / Question 2

DOP-C02 practice question: CloudWatch agent and metric streams (2 of 2)

Monitoring and Logging A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A university runs research workloads in several AWS accounts and uses an external observability platform for dashboards and alerting. The platform accepts telemetry over an HTTPS endpoint in an OpenTelemetry-compatible format.

The university wants CloudWatch metrics from the EC2 and Lambda namespaces, and from its own custom namespace, streamed to the platform in near real time. Metrics from the test accounts are not needed, and the solution should not poll the CloudWatch API.

The team wants the stream to be managed by AWS, with the least custom code.

Which approach meets these requirements?

Choose one answer.

  1. A. Install the CloudWatch agent on every instance and configure it to forward all of its metrics to the platform's HTTPS endpoint directly, with a separate configuration for each account.
  2. B. Create a metric stream in each production account with include filters for the three namespaces, OpenTelemetry output, and Firehose delivery to the platform's HTTP endpoint.
  3. C. Write a Lambda function that calls GetMetricData every minute for each namespace in each account, converts the results to the platform's format and posts them to the HTTPS endpoint.
  4. D. Build a CloudWatch dashboard in each production account with the three namespaces, and share each dashboard with the platform team so that they can review the graphs.
Show the answer and explanation

Answer: B

  • A. Wrong: The agent covers only the metrics on its own host, so Lambda metrics and most AWS namespaces would be missing. Per-account configurations also add maintenance that the university wanted to avoid. Learn more: Collect metrics, logs, and traces using the CloudWatch agent (opens in a new tab)
  • B. Right: Correct. A metric stream sends the chosen namespaces continuously, and creating streams only in the production accounts leaves out the test accounts. Firehose delivers the OpenTelemetry records to the platform's HTTP endpoint with no polling code. Learn more: Use metric streams (opens in a new tab)
  • C. Wrong: This polls the CloudWatch API, which the university asked to avoid, and it has to handle pagination, retries and format conversion. The team would maintain all of that code. Learn more: GetMetricData (opens in a new tab)
  • D. Wrong: A shared dashboard shows graphs to people but sends no telemetry to the external platform, so its dashboards and alerts receive nothing. It does not stream the metrics anywhere.

Explanation

A CloudWatch metric stream sends selected namespaces continuously to a destination, and include filters limit which namespaces leave each production account. Delivery through Amazon Data Firehose to an HTTP endpoint needs no polling code. Host agents, polling Lambda functions and shared dashboards each miss the namespaces, the no-polling rule or the delivery to the platform.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on CloudWatch agent and metric streams? The 5 full-length practice sets have 9 more CloudWatch agent and metric streams questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets