Amazon DOP-C02: Monitoring, Logging and Observability — Study Guide

Part of the AWS DevOps Engineer Professional DOP-C02 — Study Guide. Practice with verified answers in the Amazon exam hub, or take timed practice tests on ExamRoll.io.

Overview

Monitoring, logging, and observability on AWS require combining metrics, logs, traces, events, and health telemetry into actionable signals. Effective architectures use Amazon CloudWatch for metrics, alarms, and dashboards; CloudWatch Logs and Logs Insights for log ingestion and analytics; AWS X-Ray for distributed tracing; AWS CloudTrail for auditing and integrity; Amazon EventBridge for event-driven detection and automation; AWS Health for account-specific service events; and centralized pipelines (Kinesis Data Firehose and OpenSearch) for search and correlation at scale. The patterns below emphasize noise reduction, precise signal routing, automation, and multi-account/multi-Region operations.

CloudWatch Metrics, Alarms, Dashboards, and Composite Alarms

CloudWatch metrics are the foundation for SLOs, scaling, and alerting. Publish custom metrics with fine-grained dimensions to isolate signals (for example, apiOperation, appVersion, statusCode). Use the CloudWatch Embedded Metric Format (EMF) with structured logs to emit high-cardinality dimensions efficiently from Lambda, containers, and EC2, avoiding PutMetricData API overhead.

Configure alarms with robust evaluation:

Composite alarms reduce alarm fatigue by combining multiple underlying alarms with AND/OR logic. For example, alert only when p95 latency is high AND 5xx rate exceeds threshold AND CPU saturation persists, thereby aligning to user impact. Composite alarms accept state updates from child alarms across Regions/accounts via cross-account observability or metric streams into a central account.

Dashboards visualize key indicators across services. Use widgets for metrics, Logs Insights query results, and Alarm Status. Standardize dashboard conventions (naming, time ranges, SLO overlays) and leverage cross-Region/cross-account views with CloudWatch Observability Access Manager (OAM). For ad hoc correlation, pin Logs Insights and X-Ray ServiceLens widgets side-by-side with service map widgets and Kinesis Firehose error rates.

CloudWatch Logs: Log Groups, Metric Filters, Subscription Filters, and Logs Insights

Structure log groups per application/component and lifecycle stage. Set explicit retention policies (do not rely on “Never Expire”) and enable KMS encryption where required. Use resource policies and fine-grained IAM to control producers and subscribers. For high-throughput ingestion, ensure adequate log stream concurrency and batching.

Metric filters turn log patterns into metrics. Define a filter pattern with extracted tokens (JSON or space-delimited) and map tokens to metric dimensions. This supports use cases such as per-API, per-version, per-response-code metrics published directly from logs without modifying producers. Ensure units and default values are correct; prefer 1 per event and derive rates via metric math. Use these metrics for SLO alerting and dashboards.

Subscription filters stream logs in near real time to:

CloudWatch Logs Insights provides interactive, serverless query over logs. Core operators include fields, filter, parse, stats, sort, limit, dedup, and bin for time bucketing. Parse JSON fields or use grok-like parsing for text logs. Examples:

AWS X-Ray: Tracing, Sampling Rules, Service Maps, and Annotations

X-Ray captures distributed traces across services to find latency contributors and fault boundaries. Instrument services with the AWS Distro for OpenTelemetry (ADOT) or X-Ray SDKs, propagate the trace header (e.g., X-Amzn-Trace-Id), and run the X-Ray daemon/agent where needed (ECS/EKS/EC2). Many managed services integrate natively (API Gateway, ALB via access logs proxying traces, Lambda with active tracing, Step Functions via subsegments).

Sampling rules control data volume and signal fidelity. Use a central sampling rule set with:

Service maps visualize the call graph, showing edges with latency, error rates, and throttle indicators. Drill into traces to examine segments and subsegments for downstream dependencies. Use annotations (indexed key-value pairs) for high-cardinality filtering such as customerTier, apiOperation, appVersion, or AWS request IDs. Use metadata for verbose, non-indexed context to avoid index blowout. Combine X-Ray trace groups with CloudWatch ServiceLens to correlate logs, metrics, and traces in a single view. Create filter expressions (e.g., annotation.appVersion = “2.3.1” and fault = true) to isolate regressions and export trace IDs for targeted log search.

Governance and Events: CloudTrail, EventBridge, and AWS Health

CloudTrail records API activity for governance and forensic analysis. Enable an organization trail across all accounts and all Regions, deliver to a centralized S3 bucket with SSE-KMS, enable log file validation, and integrate with CloudWatch Logs for near-real-time detection. Distinguish event classes:

EventBridge provides an event fabric for detection and automation. Use the default event bus for AWS service events and create custom buses for application-domain events. Define event patterns matching source, detail-type, detail fields, prefixes, numeric ranges, and “anything-but”. Apply input transformers to reshape events, attach resource-based policies for cross-account publishing, and configure retry/DLQ on targets. Common targets include Lambda (remediation), Step Functions (orchestration), SQS (decoupling), Systems Manager Automation (ops actions), CodePipeline (CI triggers), and SNS (notifications). Archive and replay events to recover from consumer outages, and use the schema registry to generate strongly typed event models.

AWS Health surfaces account-specific service events, scheduled changes, and operational issues. Integrate via EventBridge with source aws.health and detail-type AWS Health Event to route to incident channels, open OpsCenter OpsItems, or trigger safe shutdown/scale actions for maintenance windows. Use the Organizational View with a delegated admin account to aggregate Health events across all accounts, and consider AWS Health API or the AWS Health Aware solution to push curated notifications into on-call systems.

Centralized Logging with Kinesis Data Firehose and OpenSearch

A multi-account, multi-Region logging strategy standardizes ingestion and search. In each producer account, configure CloudWatch Logs subscription filters to a cross-account Logs destination backed by a central Kinesis Data Firehose. Enable Firehose features:

Combine this pipeline with CloudWatch metric filters for fast, low-cost counters and with Logs Insights for ad hoc deep queries. Use EventBridge rules triggered by Firehose/OpenSearch anomalies or CloudWatch alarms to kick off remediations or to raise incidents.

Practical Problem Scenario

Airbnb experiences intermittent spikes in API errors and latency across microservices deployed on EKS and Lambda, with multiple mobile app versions in the wild. Operations needs near-real-time detection by API operation, response code, and app version; rapid root cause analysis across traces and logs; automated remediation for known failure patterns; and governance-grade audit trails.

  1. Standardize structured logging
  1. Create CloudWatch Logs metric filters
  1. Build layered CloudWatch alarms and a composite alarm
  1. Deploy X-Ray tracing with targeted sampling
  1. Correlate with ServiceLens and Logs Insights
  1. Centralize logs via Firehose to OpenSearch and S3
  1. Automate detection and remediation with EventBridge
  1. Integrate AWS Health and maintenance handling
  1. Harden governance with CloudTrail org trail and integrity
  1. Notifications and Ops integration

This design was chosen to combine low-latency, dimension-rich metrics (CloudWatch + EMF), deep trace correlation (X-Ray + ServiceLens), search-at-scale (OpenSearch + S3/Athena), event-driven remediation (EventBridge + Lambda/SSM/Step Functions), and auditable governance (CloudTrail with integrity). It balances cost and fidelity with sampling, retention tiers, and targeted alarms that reflect real user impact.


Infrastructure as Code and Configuration Management · All domains · Security

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Amazon →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product