Courseiva
Monitoring and Logging →mediumMultiple Choice

DOP-C02 Monitoring and Logging Practice Question

A company runs an internal REST API on Amazon API Gateway backed by AWS Lambda. The operations team wants a single CloudWatch alarm that fires when the API's overall error rate exceeds 5% during any 5-minute period, without creating one alarm per resource. The API is deployed as a REST API (not HTTP API). Which approach should a DevOps engineer take?

⚠ Common exam trap

The trap here is assuming API Gateway exposes a ready-made percentage error metric, when in fact you must compute the ratio yourself with metric math.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Create a CloudWatch metric math alarm using the expression m1/m2 where m1 is the sum of the 4XXError and 5XXError metrics and m2 is the Count metric for the stage, all with period 300 and statistic Sum.

API Gateway publishes 4XXError, 5XXError, and Count per stage. A metric math alarm can sum the error metrics and divide by Count at a five-minute period, producing a single stage-level error-rate alarm. Per-method alarms, X-Ray metrics, and log metric filters either fragment the view or do not directly yield a percentage.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Enable AWS X-Ray tracing on the stage and create a CloudWatch alarm on the X-Ray ErrorRate metric for the API.

    Why it's wrong here

    X-Ray publishes its own service metrics, but those are not the API Gateway error-rate metrics used for the 5% threshold, and enabling tracing changes sampling behavior rather than producing a stage-level alarm in one step. The team would still need a separate aggregation mechanism, so this does not satisfy the single-alarm requirement.

  • ✓

    Create a CloudWatch metric math alarm using the expression m1/m2 where m1 is the sum of the 4XXError and 5XXError metrics and m2 is the Count metric for the stage, all with period 300 and statistic Sum.

    Why this is correct

    Metric math lets a single alarm combine several API Gateway metrics. Summing 4XXError and 5XXError and dividing by Count at a 300-second period yields the stage-level error rate, so one alarm covers the whole API rather than one alarm per method or resource. This directly satisfies the 5% threshold requirement.

  • ✗

    Create one CloudWatch alarm per method with a 5% threshold and combine them into a composite alarm using an OR rule.

    Why it's wrong here

    Composite alarms can combine children, but the requirement is a single alarm on the overall API error rate, not a per-method set. This approach scales with the number of methods and still needs the rate math inside each child alarm, so it is more complex than necessary and does not aggregate at the stage level.

  • ✗

    Create a CloudWatch Logs metric filter on the API Gateway access logs and alarm on the resulting custom metric with a 5% threshold.

    Why it's wrong here

    Metric filters extract values from log events; they do not produce a ratio of errors to total requests natively. Access logging must also be enabled first, and deriving a true percentage would still require metric math or two metrics. This is a valid pattern for counts, but not the cleanest way to alarm on a rate.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.