Easy ReviewDOP-C02
Monitoring and Logging124

CloudWatch

Collect metrics and logs, detect failures with alarms, and investigate application and user experience.

CloudWatch brings together metric measurements, log events, alarms, and dashboards. Use the sections below to choose collection and delivery paths, understand alarm behavior, and investigate application health with logs, service objectives, and user experience checks.

CloudWatch basics

Amazon CloudWatch is the monitoring service of AWS: it collects metricsA metric is a sequence of measured values recorded over time. and logs from resources and applications and acts on them with alarms and dashboards.

How it works

  1. AWS services publish metrics such as CPU use to CloudWatch; the CloudWatch agent adds metrics and logs from inside instances.
  2. Dashboards show the data, and Logs stores and searches log lines.
  3. An alarm watches a metric against a threshold and triggers an action, such as an SNS notification or scaling.

Exam cues

  • If the question says monitor performance, set a threshold alert or view a dashboard, think CloudWatch.
  • If the question says collect logs from servers, think CloudWatch Logs with the CloudWatch agent.

Remember

  • Metrics, alarms, dashboards and logs.
  • The agent collects data from inside EC2 instances.

Trap: CloudWatch shows how resources behave. It does not record who called an API; CloudTrail does.

From the AWS docs (5)
  • Amazon CloudWatch monitors AWS resources and the applications running on AWS in real time.
  • CloudWatch provides metrics, alarms and dashboards for operational visibility, and collects, stores and queries logs.
  • The CloudWatch agent gathers metrics, logs and traces from Amazon EC2 instances.
  • A billing alarm watches the EstimatedCharges metric and notifies through Amazon SNS; billing alerts must be turned on first, and billing metric data is stored in US East (N. Virginia).
  • Amazon CloudWatch monitors AWS resources and applications in real time, covering resource utilization, application performance and operational health.

Metrics, dimensions, and resolution

CloudWatch metricsA metric is a sequence of measured values recorded over time. store measurements over time, such as CPU use or request latencyLatency is the delay measured for an application operation., the delay a request experiences. For traditional metrics, the namespaceA metric namespace keeps related metrics together and separates them from other metric collections. is the container, the metric name is the measurement, and dimensionsA dimension is a name and value that identifies a particular variation of a metric. are name and value pairs identifying what was measured.

How it works

  1. Publish data under a namespace, metric name, and dimension combination. Changing a dimension creates a separate metric in that Region.
  2. Choose standard or high resolutionMetric resolution describes the time granularity at which metric data is stored. for a custom metric. With PutMetricData, set StorageResolution=1 for high resolution.
  3. Select a periodA period is the time span over which metric values are combined into a statistic., the time interval over which CloudWatch calculates a statisticA statistic summarizes the metric values collected during a period.. Use an average for the mean or a percentileA percentile describes the value below which a specified percentage of samples falls. to examine the distribution. The p95 value has 95 percent of samples below it.
  4. Graph or alarm on the statistic. CloudWatch combines older measurements into coarser periods before they expire.

Exam cues

  • If the question says EC2 CPU data must arrive each minute, think detailed monitoring, because basic CPU monitoring uses 5-minute periods.
  • If the question says a healthy average hides slow requests, think a high latency percentile, because it exposes the slower part of the distribution.
  • If the question says alert before a service quota is reached, think a CloudWatch alarm on usage divided by SERVICE_QUOTA, because metric math turns usage into a percentage of the quota.

Remember

Traditional metric data period Retention
Below 60 seconds 3 hours
1 minute 15 days
5 minutes 63 days
1 hour 455 days, or 15 months
  • Standard resolution: 60 seconds. High resolution: 1 second. Maximum dimensions: 30.
  • High-resolution alarm periods include 10, 20, and 30 seconds.
  • Basic EC2 status checks already use 1-minute periods. Detailed monitoring adds charges for other 1-minute metrics.

Trap: A shorter alarm period cannot make basic EC2 CPU metrics arrive more often. Change the monitoring configuration.

Trap: These namespace, dimension, and retention rules describe traditional CloudWatch metrics. OpenTelemetryOpenTelemetry is an open framework for collecting metrics, logs, and traces using instrumentation. metrics use labels and have different storage behavior.

From the AWS docs (20)
  • A traditional CloudWatch metric is a time series identified by its namespace, name, and dimension combination.
  • A namespace separates related metrics from metrics in other namespaces; AWS service namespaces commonly start with AWS/.
  • A dimension is a name and value that identifies a variation of a traditional CloudWatch metric.
  • A traditional CloudWatch metric supports up to 30 dimensions.
  • CloudWatch does not automatically aggregate traditional custom metrics across different dimension combinations.
  • Traditional CloudWatch metrics belong to the Region where they are created.
  • Traditional custom metrics have standard resolution of 60 seconds or high resolution of 1 second.
  • PutMetricData uses StorageResolution=1 to publish high-resolution custom metrics.
  • High-resolution alarms support periods of 10, 20, or 30 seconds and cost more than standard alarms.
  • Metric data with periods shorter than 60 seconds is available for 3 hours.
  • Metric data at a 1-minute period is available for 15 days.
  • Metric data at a 5-minute period is available for 63 days.
  • Metric data at a 1-hour period is available for 455 days, or 15 months.
  • CloudWatch aggregates older metric data into coarser periods before its eventual expiration.
  • EC2 basic monitoring is the default and has no charge; status checks have 1-minute periods and other metrics have 5-minute periods.
  • EC2 detailed monitoring provides 1-minute metrics with additional per-metric charges.
  • The p95 statistic is the value below which 95 percent of samples fall; percentiles describe a distribution rather than its average.
  • A high latency percentile exposes the experience of slower requests that an average can hide.
  • CloudWatch OpenTelemetry metrics use labels rather than traditional dimensions and follow different resolution and retention behavior.
  • For services that publish usage metrics to Service Quotas, the metric math expression m1/SERVICE_QUOTA(m1)*100 shows usage as a percentage of the quota, and a CloudWatch alarm on it can notify before the quota is reached.

Agent and custom metrics

The CloudWatch agent collects measurements and log files from inside a server. It fills the gap between EC2 host monitoring and what the operating system or application knows, such as memory use and free disk space.

How it works

  1. Grant the server permission to publish telemetryTelemetry is operational data such as measurements, log events, and request traces., meaning operational measurements and events.
  2. Install the agent and configure which guest metricsA metric is a sequence of measured values recorded over time. and file paths to collect. Start the agent to send the data.
  3. Use Systems Manager for fleet management and Parameter Store to hold the configuration.
  4. For application metrics carried in logs, emit embedded metric formatEmbedded metric format places custom metric definitions and values inside structured log events. (EMF), structured log data containing metric definitions. CloudWatch extracts those metrics asynchronously without a separate PutMetricData call.

Exam cues

  • If the question says EC2 memory and disk space are missing, think CloudWatch agent, because it collects guest measurements.
  • If the question says Lambda should emit metrics without PutMetricData, think EMF, because extraction happens from log eventsA log event records an activity as a timestamp and a message..
  • If the question says configure many agents consistently, think Systems Manager and Parameter Store, because they manage installation and shared configuration.

Remember

  • Traditional agent metrics use CWAgent by default and incur custom metric charges.
  • EMF publishing needs logs:PutLogEvents, without cloudwatch:PutMetricData.
  • CardinalityMetric cardinality is the number of distinct combinations of identifying labels or dimensions. means the number of distinct dimensionA dimension is a name and value that identifies a particular variation of a metric. combinations. Each EMF combination creates a custom metric.
  • AWS recommends OpenTelemetryOpenTelemetry is an open framework for collecting metrics, logs, and traces using instrumentation. metrics for most new workloads; EMF keeps measurements with their originating log details.

Trap: A request ID is useful in a log but costly as an EMF dimension when every request creates another metric.

From the AWS docs (12)
  • The CloudWatch agent collects guest operating system metrics and log files from EC2 and on-premises servers.
  • Use the CloudWatch agent to collect guest memory and disk space metrics beyond EC2 basic monitoring.
  • Traditional CloudWatch metrics collected by the agent use CWAgent as the default namespace and are billed as custom metrics.
  • The agent setup consists of granting permissions, installing the package, configuring collection, and starting the agent.
  • Systems Manager can install and manage the CloudWatch agent; its configuration can be stored in Parameter Store.
  • CloudWatchAgentServerPolicy grants metric and log publishing permissions and GetParameter access to AmazonCloudWatch-* parameters.
  • Embedded metric format puts metric definitions and values inside structured logs so CloudWatch can extract custom metrics asynchronously.
  • Publishing embedded metric format log events requires logs:PutLogEvents without requiring cloudwatch:PutMetricData.
  • Each unique dimension combination in embedded metric format creates a custom metric, so request IDs as dimensions can increase charges.
  • AWS recommends OpenTelemetry metrics for most new workloads; embedded metric format suits workloads that need metrics kept with their originating log events.
  • On Linux, the CloudWatch agent can collect swap metrics such as swap_used, swap_free and swap_used_percent, which EC2 does not publish by itself.
  • CloudWatch Lambda Insights adds a Lambda extension layer that reports system metrics such as CPU, memory, disk and network, plus diagnostics such as cold starts.

Alarm evaluation and missing data

A CloudWatch metric alarmA metric alarm evaluates a metric over time and can trigger an action when its state changes. compares a measurement or expression with a threshold. Its periodA period is the time span over which metric values are combined into a statistic. defines each measurement interval; its evaluation settings decide how many breaches indicate a problem.

How it works

  1. Choose the metricA metric is a sequence of measured values recorded over time. or expression, statisticA statistic summarizes the metric values collected during a period., threshold, and period.
  2. Set Evaluation Periods to N and Datapoints to Alarm to M. The alarm counts M breaches within N periods; breaches need not be consecutive.
  3. With the default sliding window, CloudWatch looks farther back for real points before filling missing dataMissing data means an expected metric data point was not received for an evaluation period.. The missing-data setting matters only when it cannot obtain enough real points.
  4. Evaluate as OK, ALARM, or INSUFFICIENT_DATA, meaning healthy, breaching, or unable to decide from the available data.
Missing-data setting Meaning when gaps must be filled
missing Default; an entirely absent evaluation range gives INSUFFICIENT_DATA
notBreaching Treat gaps as healthy
breaching Treat gaps as a problem
ignore Keep the current state

Exam cues

  • If the question says a metric emits only on application errors, think notBreaching, because silence does not indicate errors.
  • If the question says a heartbeat must always report, think breaching, because silence can indicate failure.
  • If the question says stop or recover EC2 automatically, think missing with actions only in ALARM, because metric interruptions can occur while the instance is healthy.

Remember

  • Three out of five means any 3 breaches among 5 available periods, not necessarily consecutive.
  • Periods of at least 1 minute normally evaluate each minute.
  • Evaluation intervals longer than 1 day evaluate hourly.

Trap: Selecting breaching does not force every absent recent point to count as bad. The default sliding window first uses real points from its wider evaluation range.

From the AWS docs (12)
  • A metric alarm has OK, ALARM, and INSUFFICIENT_DATA states.
  • Evaluation Periods specifies N recent periods and Datapoints to Alarm specifies M breaches; breaching points need not be consecutive.
  • Alarms with periods of at least 1 minute evaluate every minute unless their total evaluation interval exceeds 1 day.
  • An alarm whose period multiplied by evaluation periods exceeds 1 day evaluates hourly.
  • The default missing-data option is missing; an entirely missing evaluation range yields INSUFFICIENT_DATA.
  • notBreaching treats missing data as within the threshold.
  • breaching treats missing data as violating the threshold.
  • ignore retains the current alarm state when missing-data handling is required.
  • With the default sliding window, CloudWatch retrieves extra data and uses the missing-data setting only when too few real points are available.
  • For a metric that reports only errors, notBreaching prevents absent error data from being treated as a fault.
  • For a continually reporting application health metric, breaching can make missing telemetry indicate a problem.
  • AWS recommends missing and actions only in ALARM for EC2 alarms that stop, terminate, reboot, or recover instances.

Alarm actions and composite alarms

CloudWatch alarm actions turn a detected condition into a notification or response. A composite alarmA composite alarm evaluates a logical rule over the states of other alarms. combines other alarms so related symptoms can produce a single notification.

How it works

  1. Create metric alarmsA metric alarm evaluates a metric over time and can trigger an action when its state changes. for the measurements that indicate trouble. Attach direct responses where needed.
  2. Create a composite rule such as ALARM("cpu") AND ALARM("errors"). It reads child alarm states, not metricA metric is a sequence of measured values recorded over time. values.
  3. Notify from the composite when the combined condition holds. Use SNS, a message delivery service, or another supported action.
  4. Keep EC2 and Auto Scaling actions on metric alarms. EventBridge rules can also route alarm state-change events to automation.
Action Metric alarm Composite alarm
SNS notification or Lambda function Supported Supported
Systems Manager action Supported Supported
EC2 stop, terminate, reboot, or recover Supported Not supported
Auto Scaling action Supported Not supported

Exam cues

  • If the question says several related alarms cause duplicate paging, think a composite condition, because it combines child states before notifying.
  • If the question says one combined alert and EC2 recovery, think separate composite and metric actions, because a composite cannot recover EC2.
  • If the question says the EC2 host has a system status failure, think recovery with StatusCheckFailed_System, because recovery addresses underlying host impairment.
  • If the question says alert when estimated charges pass a threshold, think a CloudWatch billing alarm in US East (N. Virginia) or AWS Budgets, because both alert on spend.

Remember

  • Composite rules use AND, OR, NOT and state tests ALARM, OK, INSUFFICIENT_DATA.
  • Reboot suits an instance status failure; recovery suits a system status failure.
  • Cross-account composite alarm creation is unsupported.

Trap: A composite alarm that invokes Lambda does not gain a native EC2 recovery action. Put the native recovery action on the metric alarm.

From the AWS docs (10)
  • Metric alarms can trigger SNS notifications, Lambda functions, EC2 actions, Auto Scaling actions, and supported Systems Manager actions.
  • A composite alarm evaluates states of other alarms rather than metric values.
  • Composite rules use ALARM, OK, and INSUFFICIENT_DATA tests with AND, OR, NOT, and parentheses.
  • Composite alarms support SNS, Lambda, Systems Manager actions, and CloudWatch investigations.
  • Composite alarms cannot perform EC2 or Auto Scaling actions.
  • Creating cross-account composite alarms is not supported.
  • EC2 alarm actions include stop, terminate, reboot, and recover.
  • For EC2 system status failures, use a recovery alarm on StatusCheckFailed_System; StatusCheckFailed_Instance is not a recovery trigger.
  • A reboot action suits instance status check failures and restarts the operating system on the same host.
  • CloudWatch sends alarm state-change events to EventBridge, where rules can route them to targets.

Anomaly detection

CloudWatch anomaly detection learns an expected range for a measurement. It helps when normal traffic rises and falls so a fixed threshold cannot distinguish an expected peak from a problem.

How it works

  1. Select a metricA metric is a sequence of measured values recorded over time. and statisticA statistic summarizes the metric values collected during a period., such as average CPU utilization. The model belongs to that metric and statistic combination.
  2. CloudWatch trains on up to 2 weeks of history, including hourly, daily, and weekly patterns. It can start with less history.
  3. Set the threshold that controls the width of the expected band. A larger value makes the band wider.
  4. Choose whether an alarm should detect values above, below, or outside either side of the band. Exclude unusual training intervals such as deployments.

Exam cues

  • If the question says a static threshold pages on normal seasonal peaks, think anomaly detection, because its expected band follows recurring patterns.
  • If the question says a deployment distorted the baseline, think training exclusions, because the deployment should not teach normal behavior.

Remember

  • Training uses up to 2 weeks, not a mandatory waiting periodA period is the time span over which metric values are combined into a statistic..
  • Models are specific to a metric and statistic.
  • Supported metric math expressions can also use anomaly detection.

Trap: Increasing the threshold widens the band. It makes the alarm less sensitive to variation, not more sensitive.

From the AWS docs (8)
  • CloudWatch anomaly detection models expected metric values from historical behavior rather than a fixed threshold.
  • The model accounts for hourly, daily, and weekly patterns as well as longer trends.
  • Training uses up to 2 weeks of history and does not require a full 2 weeks before enabling detection.
  • An anomaly detection model is specific to both a metric and its statistic.
  • Increasing the anomaly detection threshold widens the band of expected values.
  • An anomaly alarm can detect values above the expected band, below it, or on either side.
  • Specified intervals such as deployments or incidents can be excluded from model training.
  • CloudWatch supports anomaly detection on supported metric math expressions as well as individual metrics.

Log groups and retention

CloudWatch Logs stores timestamped events from applications and infrastructure. A log streamA log stream is a sequence of log events from the same source. holds events from one source; a log groupA log group collects streams that share retention, monitoring, and access settings. collects streams that need the same retention, monitoring, and access settings.

How it works

  1. Create a log group for streams with a shared storage and access policy. Each producer writes its events to a stream.
  2. Choose how long to retain events. Without configured retention or an overriding account policy, storage does not expire.
  3. For a common account rule, apply an account-level retention policy. RETROACTIVE includes matching existing groups; NEW_ONLY applies to groups created after the policy.

Exam cues

  • If the question says many application instances need common retention, think streams in a shared group, because retention belongs to the group.
  • If the question says existing groups must inherit a common account retention policy, think RETROACTIVE, because NEW_ONLY covers future groups.
  • If the question says protect a log group from accidental deletion, think deletion protection, because deletion remains blocked until protection is disabled.
  • If the question says cheaper ingestion for rarely queried logs, think the Essentials log class (formerly Infrequent Access), chosen when the log group is created. Choose Standard when Live Tail or subscription filtersA subscription filter selects incoming log events and sends matches to a processing destination. are required.

Remember

  • Default retention: indefinite. Streams per group: no limit.
  • An applicable account-level policy overrides the group’s own retention setting.
  • Among overlapping account policies, the longest retention wins; NEVER_EXPIRE is longest.
  • Deletion protection is off by default. It protects the log group; event retention remains a separate setting.
  • Private subnets reach CloudWatch Logs through an interface VPC endpointAn endpoint is the URL a canary requests when it calls an API..

Trap: A longer group retention value does not defeat a shorter applicable account policy. The account policy overrides the group value.

From the AWS docs (11)
  • A CloudWatch log event contains a timestamp and message describing an activity.
  • A log stream is a sequence of events from the same source.
  • A log group contains streams with shared retention, monitoring, and access controls.
  • A log group has no limit on its number of log streams.
  • CloudWatch Logs stores data indefinitely by default unless retention is configured or an applicable account policy overrides it.
  • An applicable account-level retention policy overrides a log group retention setting.
  • Account-level retention supports RETROACTIVE for matching existing and future groups or NEW_ONLY for groups created after the policy.
  • When account-level retention policies overlap, the longest retention applies; NEVER_EXPIRE is treated as the longest.
  • CloudWatch Logs deletion protection is off by default and prevents deletion of the log group until protection is disabled.
  • CloudWatch Logs Standard provides the full feature set; Essentials (formerly Infrequent Access, noted November 2026) lowers ingestion cost but excludes Live Tail and subscription filters. Storage and Logs Insights query prices are the same, and a log group's class is fixed at creation.
  • An interface VPC endpoint powered by AWS PrivateLink lets resources in a VPC send logs to CloudWatch Logs over private IP addresses.

Metric filters and patterns

A CloudWatch Logs metric filterA metric filter turns matching incoming log events into numeric metric values. converts matching incoming log eventsA log event records an activity as a timestamp and a message. into numbers that an alarm can monitor. Think of it as a counter on arriving events, rather than a search over stored history.

How it works

  1. Collect application logs in a Standard log class group. Choose a filter patternA filter pattern is an expression that identifies matching log events., which is an expression describing which events match.
  2. Set the metric namespaceA metric namespace keeps related metrics together and separates them from other metric collections., name, and value. A value of 1 counts each matching event. For JSON, structured data with named fields, { $.status = 500 } matches a numeric status field.
  3. Default 0 covers a minute with ingested logs but no matches. No ingestion still means no datapoint.
  4. Create a metric alarmA metric alarm evaluates a metric over time and can trigger an action when its state changes. on the generated metricA metric is a sequence of measured values recorded over time.. Use Logs Insights separately to investigate stored history.

Exam cues

  • If the question says alert on new application error messages, think metric filter followed by metric alarm, because the filter converts log matches into measurements.
  • If the question says JSON logs have numeric status 500, think { $.status = 500 }, because it matches that field value.
  • If the question says count errors already stored before filter creation, think Logs Insights, because metric filters do not backfill.

Remember

  • Standard log class only. New events only.
  • Value 1 counts matches. Default 0 requires incoming logs during that minute.
  • Filter patterns and Logs Insights queries have different syntax.

Trap: Default zero does not prove that logging is alive. A silent producer generates no datapoint.

From application logs to an alarm
123Log groupMetric filterCustom metricMetric alarm
  1. New events reach the metric filter.

  2. Matching events publish metric values.

  3. The metric alarm evaluates the generated metric.

From the AWS docs (11)
  • A CloudWatch Logs metric filter turns matching ingested log events into numerical CloudWatch metric data.
  • Metric filters are supported only on Standard log class groups.
  • Metric filters publish data only for events after filter creation; they do not backfill stored events.
  • A metric filter specifies a pattern, metric namespace, metric name, and metric value.
  • A metric value of 1 counts occurrences of matching events.
  • A default value of 0 reports zero when logs arrive in a minute but none match.
  • A metric filter emits no value for a minute in which no logs are ingested, even if its default value is 0.
  • A JSON filter can compare a numeric field with a value, such as { $.status = 500 }.
  • Filter patterns support matching terms in text, JSON, and space-delimited logs; Logs Insights has a separate query language.
  • The CloudWatch metric produced by a log filter can be graphed or used by a metric alarm.
  • JSON and space-delimited metric filters can publish up to three dimensions; dimension values are charged like custom metrics, so avoid high-cardinality fields such as IP addresses or request IDs.

Logs Insights

CloudWatch Logs Insights searches stored log eventsA log event records an activity as a timestamp and a message. to answer questions about past behavior. Use it when the evidence is already in the logs and a newly created metric filterA metric filter turns matching incoming log events into numeric metric values. would start too late.

How it works

  1. Choose the log groupsA log group collects streams that share retention, monitoring, and access settings. and time range for the investigation.
  2. Select a query language to specify how to select and combine records.
  3. With Logs Insights QL, use fields to select fields, filter to restrict events, stats to calculate aggregates, and sort to order results. Pipes pass results between commands.
  4. Use automatically discovered fields in supported logs and JSON. Field indexes, lookup structures for selected fields, can reduce how much data a query scans.
  5. Inspect results or add a query to a dashboard for repeated viewing.
  6. Use a scheduled query to run log analysis regularly and deliver results to a destination such as Amazon S3.
  7. For unexpected log patterns, use log anomaly detection. A detector monitors continuously; a Logs Insights anomaly detection query analyzes logs on demand.

Exam cues

  • If the question says count errors already logged last week, think Logs Insights, because it queries stored events.
  • If the question says investigate request details and aggregate failures, think query filtering and statisticsA statistic summarizes the metric values collected during a period., because they operate on the selected log records.
  • If the question says reduce repeated query scan volume, think field indexes and a focused time range, because charges depend on data scanned.
  • If the question says run a log query regularly and save its results to S3, think scheduled queries, because they automate execution and delivery.

Remember

  • Field indexes can reduce query scan volume.

Trap: A metric filter does not count yesterday’s stored events when created today. Use a historical query.

From the AWS docs (11)
  • CloudWatch Logs Insights interactively searches and analyzes stored CloudWatch log events.
  • Logs Insights automatically discovers fields in supported AWS service logs and JSON application logs.
  • Logs Insights charges depend on data scanned regardless of query language.
  • Field indexes can reduce scan volume and improve query performance.
  • Logs Insights QL pipes commands such as fields, filter, stats, and sort to select, restrict, aggregate, and order events.
  • Logs Insights query results can be added to a CloudWatch dashboard.
  • CloudWatch scheduled queries run log queries on a schedule and can deliver results to Amazon S3.
  • A newly created metric filter does not process historical events.
  • CloudWatch Contributor Insights rules analyze structured log events and rank the top contributors by a field, such as the instance or IP that sends the most errors.
  • Metric math's INSIGHT_RULE_METRIC function turns a Contributor Insights rule into a metric, so an alarm can fire, for example, when the top contributor's share of the total is too high.
  • CloudWatch Logs can learn normal log patterns and flag deviations with a continuous log anomaly detector or an on-demand Logs Insights anomaly detection query.

Log encryption and data protection

CloudWatch Logs encrypts stored events by default. A customer managed KMS key gives you control over the encryption key; a data protection policy controls which sensitive fields appear in output.

How it works

  1. For customer managed encryption, choose a symmetric keyA symmetric encryption key uses the same secret key to encrypt and decrypt data., one that uses the same secret for encryption and decryption. Its policy must permit the regional logs.<region>.amazonaws.com service identity.
  2. Restrict key use to the log groupA log group collects streams that share retention, monitoring, and access settings. with kms:EncryptionContext:aws:logs:arn. Associate the key through the API or CLI for an existing group.
  3. Allow up to 5 minutes for association to take effect. Newly ingested events use that key; existing events keep their original encryption.
  4. To hide sensitive fields in output, apply a data protection policy. It detects data at ingestion and masks it when it leaves through queries, metric filtersA metric filter turns matching incoming log events into numeric metric values., or subscriptions. logs:Unmask permits viewing originals.
  5. If encryption must happen before submission, encrypt in the application. Envelope encryptionEnvelope encryption encrypts data with a data key and encrypts that data key with another key. uses a data key for the payload and stores encrypted copies of that key with the message.
Requirement Mechanism Where it applies
Protect API traffic TLSTransport Layer Security encrypts network connections to protect data in transit., encryption over the network In transit
Control stored log encryption keys Symmetric customer managed KMS key Newly ingested stored data
Hide sensitive fields in output Data protection policy Detected events after policy creation
Encrypt before leaving the application Client-side encryptionClient-side encryption encrypts data in the application before sending it to a service. Application, before service receipt

Exam cues

  • If the question says use a customer managed key for stored logs, think KMS association and key policy, because the service needs permission to use that key.
  • If the question says hide sensitive output without changing the app, think data protection policy, because maskingData masking hides detected sensitive values in log output unless the reader has permission to view the originals. applies at egress.
  • If the question says encrypt before transmission to CloudWatch, think client-side envelope encryption, because storage encryption happens after receipt.

Remember

  • Stored logs use AES-GCM by default. Customer managed log group keys must be symmetric.
  • Existing group key association requires CLI or API and can take up to 5 minutes.
  • Masking policies do not cover events ingested before policy creation.
  • Disassociating a key does not remove the need to decrypt older data with it.

Trap: Disabling, deleting, or revoking access to a KMS key can make retained logs unreadable. Disassociation does not re-encrypt that history.

From the AWS docs (15)
  • CloudWatch Logs encrypts stored log data by default with AES-GCM.
  • CloudWatch Logs log group encryption supports only symmetric KMS keys.
  • The KMS key policy must allow the regional CloudWatch Logs service principal, logs.<region>.amazonaws.com, to use the key.
  • The kms:EncryptionContext:aws:logs:arn condition can restrict key use to a specific log group.
  • Associating a KMS key encrypts newly ingested data with that key; older data retains its original encryption.
  • Associating or disassociating a KMS key can take up to 5 minutes to take effect.
  • Associating a KMS key with an existing log group requires the CLI or API rather than the CloudWatch console.
  • Disabling or deleting a key, or revoking CloudWatch Logs access to it, prevents reading data encrypted with that key.
  • Disassociating a key does not remove the need for that key to read older data encrypted with it.
  • Data protection policies can apply at account or log group level and detect sensitive data at ingestion.
  • Selected sensitive data is masked at egress points including Logs Insights, metric filters, and subscriptions; logs:Unmask permits viewing originals.
  • A data protection policy does not mask events ingested before the policy existed.
  • The AWS Encryption SDK encrypts application data with a data key and stores encrypted copies of that data key with the encrypted message.
  • The AWS Encryption SDK encrypts data in the application before sending it to a service, while server-side encryption happens after receipt.
  • CloudWatch API communication uses TLS to protect data in transit.

S3 log exports

A CloudWatch Logs export taskA log export task copies a selected time range of stored log events to an S3 bucket. copies a selected log groupA log group collects streams that share retention, monitoring, and access settings. time range to S3. It suits a batch archive or analysis job, while a subscription to Firehose suits continuous delivery.

How it works

  1. Choose an S3 bucket in the same Region as the source logs. A different account is allowed.
  2. Grant the caller export permissions. Let the regional CloudWatch Logs service identity write to the bucket, with aws:SourceAccount and aws:SourceArn conditions restricting the sources.
  3. Create an export task with the log group, time range, bucket, and optional object prefixAn object prefix is the shared beginning of S3 object names used to group exported files., the shared beginning of exported object names.
  4. Wait for the task. Logs can take up to 12 hours to become exportable; task runtime depends on volume and can span seconds to hours.
  5. Apply S3 lifecycle rules to archive or delete files. Define an Athena table to query their format. For continuous archival, use a subscription to Firehose rather than repeated exports.

Exam cues

  • If the question says copy a historical range to S3, think export task, because it operates on a selected batch.
  • If the question says continuously archive new logs, think subscription and Firehose, because AWS recommends subscriptions for that use.
  • If the question says an export times out, think smaller time ranges, because tasks have a 24-hour timeout.

Remember

  • Export bucket: same Region, same or different account.
  • Availability for export can lag ingestion by up to 12 hours.
  • SSE-KMSSSE-KMS is server-side encryption that uses AWS KMS keys to protect stored S3 objects., meaning S3 storage encryption using KMS, is supported. DSSE-KMS, its dual-layer variant, is not supported for exports.

Trap: An export task is not a live log feed. Choosing it for near-real-time delivery introduces both availability lag and batch processing.

From the AWS docs (12)
  • CreateExportTask copies a selected CloudWatch log group time range into an S3 bucket for batch processing.
  • The S3 bucket must be in the same Region as the source logs; it can belong to another account.
  • An export needs caller export permissions and a bucket policy allowing the regional CloudWatch Logs service principal to write objects.
  • The export bucket policy uses aws:SourceAccount and aws:SourceArn to restrict authorized log sources.
  • Log data can take up to 12 hours to become available for export.
  • An export task times out after 24 hours; reducing the requested time range can avoid a timeout.
  • An export task can take from seconds to hours depending on data size.
  • AWS recommends subscriptions rather than recurring export tasks for continuous archival to S3.
  • Exports support S3 buckets with SSE-KMS encryption but not DSSE-KMS encryption.
  • S3 lifecycle rules can archive or delete exported files automatically.
  • Athena can query CloudWatch logs stored in S3 after a table describes the exported data.
  • A CloudWatch Logs subscription can send logs to Firehose for delivery to S3.

Dashboards

A CloudWatch dashboard puts metricA metric is a sequence of measured values recorded over time. graphs, alarm states, and log query results in one view. A widgetA widget is a dashboard panel that displays data or explanatory text. is an individual panel that displays one of those views.

How it works

  1. Create a dashboard in the console or supply a JSON DashboardBody to PutDashboard. Dashboards are global within an account and can show resources from different Regions.
  2. Add widgets that answer the operational question. Use the table below to choose their contents.
  3. For a log query widget, run a Logs Insights query and choose Add to dashboard. The query runs again when the dashboard loads or refreshes.
  4. Keep log queries focused on the necessary log groupsA log group collects streams that share retention, monitoring, and access settings. and time range. Avoid frequent refreshes, because they repeat query work and increase query charges.
Widget Use
Graph One or more metric series
Single alarm The alarm’s metric graph and current state
Alarm status Names and states of multiple alarms without graphs
Logs Insights query Results from a saved dashboard query
Metrics explorer Metrics for resources matching tags or properties, following resource changes
Text Markdown guidance for operators

Exam cues

  • If the question says show CPU, alarm state, and log error counts together, think metric, alarm, and Logs Insights widgets, because each supplies a different view.
  • If the question says follow a changing fleet by tags, think metrics explorer, because matching resources are added or removed automatically.
  • If the question says dashboard query usage rose after faster refreshes, think repeated log queries, because every refresh runs them again.

Remember

  • Dashboard scope is global within the account; displayed metrics can come from multiple Regions.
  • A dashboard refresh runs its Logs Insights queries and consumes concurrent query capacity.
  • PutDashboard replaces the entire dashboard body when updating an existing dashboard.

Trap: Sending only a new widget to PutDashboard replaces the existing contents. Send the complete intended dashboard body.

From the AWS docs (11)
  • CloudWatch dashboards combine selected metric and alarm views across Regions.
  • CloudWatch dashboards belong to an account globally rather than to a single Region.
  • Graph widgets display one or more metrics.
  • A single-alarm widget shows its metric graph and state; an alarm status widget shows alarm names and states without graphs.
  • Metrics explorer widgets follow resources matching tags or resource properties as those resources are created or deleted.
  • Text widgets support Markdown for operational guidance.
  • After running a Logs Insights query, use Add to dashboard to create a widget for it.
  • Dashboard log queries run when the dashboard loads and refreshes and count toward concurrent Logs Insights query usage.
  • AWS recommends limiting log groups and time ranges and avoiding frequent dashboard query refreshes to reduce Logs Insights query charges.
  • PutDashboard creates a dashboard or replaces the entire contents of an existing dashboard with the supplied JSON DashboardBody.
  • A widget is a dashboard panel that displays data or explanatory text.

Metric streams

A metricA metric is a sequence of measured values recorded over time. stream continuously sends CloudWatch metric updates through Data Firehose to S3 or another supported destination. It moves measurements that already exist in CloudWatch to another system.

How it works

  1. Choose a custom Firehose delivery stream, quick S3 setup, or a supported partner setup. Firehose is the delivery layer that forwards the updates to the chosen destination.
  2. Give the metric-stream IAM roleAn IAM role is an identity with permissions that an authorized user, application, or service can assume., a permission identity assumed by a service, trust for streams.metrics.cloudwatch.amazonaws.com. Allow firehose:PutRecord and firehose:PutRecordBatch on the delivery stream.
  3. Select all metrics or use include filters or exclude filters on namespaces or metric names. A namespaceA metric namespace keeps related metrics together and separates them from other metric collections. is a named collection of metrics. All dimensionA dimension is a name and value that identifies a particular variation of a metric. combinations, the name/value labels identifying a metric series, are sent for a selected metric name and namespace. New matching metrics are included automatically.
  4. Choose the output format. A monitoring accountA monitoring account views operational data shared by linked source accounts. can include linked source-account metrics. Updates are sent every minute; Firehose buffers by size or wait time, and delivery can arrive out of order.
Output format Selection
JSON JSON-formatted metric records
OpenTelemetryOpenTelemetry is an open framework for collecting metrics, logs, and traces using instrumentation. 1.0.0 OpenTelemetry 1.0.0 encoding
OpenTelemetry 0.7.0 OpenTelemetry 0.7.0 encoding

Exam cues

  • If the question says continuously deliver metrics to an external tool, think metric stream and Firehose, because this path pushes updates to a supported destination.
  • If the question says include metrics created later, think a matching stream filter, because new matching metrics enter the stream automatically.
  • If the question says the stream is Running but empty, think filter selection, because Running alone does not imply matching data exists.

Remember

  • Up to 1000 include filters or exclude filters; a stream cannot mix those modes.
  • Formats: JSON, OpenTelemetry 1.0.0, OpenTelemetry 0.7.0.
  • Always included statisticsA statistic summarizes the metric values collected during a period.: Minimum, Maximum, SampleCount, Sum.
  • Updates are sent every minute. Timestamps more than two days old are excluded.
  • Firehose bufferingBuffering holds records until a configured size or waiting time is reached before delivery. affects final latencyLatency is the delay measured for an application operation.; arrival order is not guaranteed.

Trap: Metric streams export existing metrics. A requirement to create metrics from incoming logs calls for a metric filterA metric filter turns matching incoming log events into numeric metric values..

Metric updates reach S3 through Firehose
updates1deliver2CloudWatchmetric streamFirehosebuffer + deliverS3 bucketmetric records
  1. The metric stream sends selected CloudWatch metric updates to Firehose using its delivery role.

  2. Firehose buffers and delivers records to the configured S3 destination.

From the AWS docs (18)
  • Metric streams continuously deliver CloudWatch metric updates through Data Firehose to S3 or another supported destination.
  • Metric streams support JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0 output formats.
  • A metric stream supports up to 1000 include filters or exclude filters for namespaces or specific metrics, but cannot mix the two filter modes.
  • New metrics matching an existing stream filter are included automatically.
  • A monitoring-account metric stream can include metrics from linked source accounts.
  • CloudWatch offers custom Firehose setup, quick S3 setup with needed resources created by default, and quick setup for supported partners.
  • Selecting a metric name and namespace streams all dimension combinations for that metric.
  • Metric stream data is sent every minute and can reach the destination out of order.
  • Metric streams exclude metrics whose timestamps are more than two days old.
  • Final destination latency depends on Firehose buffering by payload size or maximum wait time, whichever is reached first.
  • The metric-stream IAM role must trust streams.metrics.cloudwatch.amazonaws.com.
  • The metric-stream role needs firehose:PutRecord and firehose:PutRecordBatch permissions scoped to the delivery stream.
  • Metric streams always include Minimum, Maximum, SampleCount, and Sum; additional statistics can be configured.
  • A Running metric stream can have no output if its filters match no data.
  • A metric namespace keeps related metrics together and separates them from other metric collections.
  • A dimension is a name and value that identifies a particular variation of a metric.
  • An IAM role is an identity with permissions that an authorized user, application, or service can assume.
  • Metric filters turn matching incoming log events into numeric CloudWatch metrics.

Synthetics and release diagnostics

CloudWatch Synthetics runs canaries, scripts that exercise endpointsAn endpoint is the URL a canary requests when it calls an API., the addresses applications call, or user actions without waiting for customers. A canaryA canary is a script that exercises an endpoint or user flow without requiring customer traffic. acts as a scheduled test user and leaves measurements and run evidence for diagnosis.

How it works

  1. Write a script or choose a blueprintA canary blueprint is a starting script for a common synthetic check., a starting script for a common check. Canaries use NodeA worker node is a machine that runs Kubernetes application workloads..js, Python, or Java and run through Lambda functions created in your account. Java runtimes do not include browser support.
  2. Run the canary once or schedule it using cron, a calendar-style schedule expression, or rate, a repeated interval. Checks can run as often as once per minute.
  3. Read SuccessPercent and Duration in the CloudWatchSynthetics namespaceA metric namespace keeps related metrics together and separates them from other metric collections.. The former measures successful runs without failures; the latter measures run time in milliseconds.
  4. Investigate a failed run using steps, screenshots, logs, and HTTP ArchiveAn HTTP Archive file records details about web requests and their performance. (HAR) files, which record web-request performance details. Logs are stored in S3 and CloudWatch Logs; screenshots, HAR files, and reports go to S3. Compare failed-run evidence with a successful run when diagnosing a release problem.
Blueprint What it checks
Heartbeat Loads a URL and stores a screenshot, HAR file, and URL logs
API canary Exercises an application programming interface (API), the interface other programs call, including multiple calls
Broken linkAn observability link is a source account resource that connects it to a monitoring account sink. checker Follows links up to the configured count, including the starting URL
Visual monitoring Compares screenshots with a baseline and fails beyond a configured difference threshold

Exam cues

  • If the question says prove checkout works without customer traffic, think Synthetics, because a canary generates the user actions.
  • If the question says pages still respond but links are broken, think broken link checker, because it follows links and records their failures.
  • If the question says detect unexpected visual changes after a release, think visual monitoring, because screenshots are compared with a baseline.
  • If the question says a release broke one checkout step, think failed-run details and a successful-run comparison, because the artifacts show the failing action and requests.

Remember

  • Maximum schedule frequency: once per minute.
  • Canary metricsA metric is a sequence of measured values recorded over time. use CloudWatchSynthetics; Duration is in milliseconds.
  • Visual monitoring needs a supported Puppeteer runtime; Python/Selenium and Playwright runtimes do not support that blueprint.
  • Broken-link limits include the initial URL.

Trap: A successful HTTP response does not prove the page looks right. A visual comparison can detect a layout change while requests still succeed.

A canary exercises an endpoint and records its run
exercise1publish metrics2store evidence3CanaryLambda executionEndpointscripted requestsCloudWatchsuccess + durationS3 artifactsscreenshots + reports
  1. The canary runs its script against the endpoint independently of customer traffic.

  2. The canary publishes SuccessPercent and Duration to CloudWatch.

  3. S3 stores screenshots, HAR files, and reports for diagnosis.

From the AWS docs (24)
  • Synthetics canaries run scripted endpoint and user-flow checks without requiring customer traffic.
  • Canary scripts use Node.js, Python, or Java and create Lambda functions in the account.
  • Canaries can run once or on a schedule as often as once per minute using cron or rate expressions.
  • Java canary runtimes do not include browser support or browser frameworks.
  • Canaries publish metrics in the CloudWatchSynthetics namespace.
  • SuccessPercent measures the percentage of canary runs that succeed without failures.
  • Duration measures canary run duration in milliseconds.
  • Canary run logs are stored in S3 and CloudWatch Logs; the details page exposes steps, screenshots, logs, and HAR files where available.
  • Synthetics stores screenshots, HAR files, and reports in the configured S3 bucket.
  • A HAR file is an HTTP Archive recording web-request performance details.
  • The heartbeat blueprint loads a URL and stores a screenshot, a HAR file, and logs of accessed URLs.
  • API canaries test API functionality and can perform multiple calls.
  • The broken link checker follows page links up to the configured count, including the starting URL in that count.
  • Visual monitoring compares screenshots against a baseline and fails when the difference exceeds the configured percentage threshold.
  • The visual monitoring blueprint requires a supported Puppeteer runtime and does not support Python/Selenium or Playwright runtimes.
  • For a failed canary, inspect SuccessPercent, failed-run steps, screenshots, HAR files, and logs and compare them with a successful run.
  • CloudWatch RUM collects performance information from actual user sessions.
  • A canary is a script that exercises an endpoint or user flow without requiring customer traffic.
  • A canary blueprint is a starting script for a common synthetic check.
  • Canary rate expressions specify a repeated interval; cron expressions specify scheduled times.
  • An endpoint is the URL a canary requests when it calls an API.
  • An application programming interface (API) is an interface that other programs call to use application functionality.
  • CloudWatch Network Synthetic Monitor measures packet loss and latency between a VPC subnet and on-premises IP addresses over hybrid links, with no agents to install.
  • CloudWatch Application Insights scans an application resources, sets up recommended metrics and logs for its components, and flags common problems.

Real user monitoring

CloudWatch RUM measures the experience of actual users in web and mobile applications. Client-side dataClient-side data describes performance and errors observed in the user application or browser. comes from the user’s application or browser, helping explain delays and errors that server measurements alone do not describe.

How it works

  1. Create an app monitorAn app monitor holds the RUM configuration for collecting data from an application., the RUM configuration for an application. For a web application, add the generated code snippet to load the RUM client, the code that captures and sends session data.
  2. Choose the session samplingSession sampling selects a configured percentage of real user sessions for data collection. percentage, the share of sessions to record. The web app monitor creation workflow defaults to 100%; reducing it collects less data and reduces charges.
  3. Choose collection options such as Performance telemetryTelemetry is operational data such as measurements, log events, and request traces., JavaScript errors, and HTTP errors. Examine page load times, client errors, and usage breakdowns by devices or operating systems.
  4. If you need longer retention, copy telemetry to CloudWatch Logs and set the log groupA log group collects streams that share retention, monitoring, and access settings.’s retention. To connect sampled client requests to Application Signals, enable X-Ray active tracing for the monitor and Application Signals for the application.

Exam cues

  • If the question says users on one browser experience slow pages, think RUM, because it records client performance from actual sessions and supports usage breakdowns.
  • If the question says keep RUM data longer, think CloudWatch Logs copies, because the log group has its own retention setting.
  • If the question says test a page when no users are present, think Synthetics, because a canaryA canary is a script that exercises an endpoint or user flow without requiring customer traffic. generates scheduled checks.

Remember

  • RUM end-user data retention is 30 days, followed by automatic deletion.
  • The web monitor creation workflow defaults to 100% session sampling.
  • Copying telemetry to Logs gives the copy a separate retention policy.

Trap: RUM measures actual sessions. A quiet application needs synthetic checks to exercise its user flows without customer traffic.

From the AWS docs (13)
  • CloudWatch RUM collects client-side performance information from actual web and mobile user sessions.
  • RUM web data includes page load times, client-side errors, and user behavior.
  • RUM provides breakdowns by device type, operating system, and other usage characteristics.
  • RUM retains end-user data for 30 days and then deletes it automatically.
  • An app monitor can copy RUM telemetry to CloudWatch Logs for retention controlled by the log group.
  • Creating a web app monitor generates a code snippet that loads the RUM client to capture and send session data.
  • The web app monitor creation workflow defaults to sampling 100% of sessions; reducing the percentage reduces collected data and charges.
  • Web app monitor collection options include Performance telemetry, JavaScript errors, and HTTP errors.
  • Enabling X-Ray active tracing for a RUM monitor lets sampled client requests appear in Application Signals when it is enabled for the application.
  • Synthetics canaries generate scheduled checks even when there is no customer traffic.
  • An app monitor holds the RUM configuration for collecting data from an application.
  • Session sampling selects a configured percentage of real user sessions for data collection.
  • Client-side data describes performance and errors observed in the user application or browser.

Container Insights

Container Insights collects performance measurements and logs from container workloads such as ECS and EKS. It helps locate resource pressure and container failures across the workload’s layers.

How it works

  1. Choose the collection approach. For new EKS deployments, AWS recommends OTelOpenTelemetry is an open framework for collecting metrics, logs, and traces using instrumentation. Container Insights. OpenTelemetry (OTel) is a standard framework for collecting operational data; PromQLPromQL is the query language used to select and calculate results from Prometheus metrics. is the query language used for Prometheus metricsA metric is a sequence of measured values recorded over time..
  2. Meet the OTel prerequisites: EKS 1.28 or later and the amazon-cloudwatch-observability add-on v6.2.0 or later. Give the collector the publishing permissions listed in CloudWatchAgentServerPolicy.
  3. Collect CPU, memory, disk, and network measurements alongside container diagnostics. Classic builds CloudWatch metrics from performance log eventsA log event records an activity as a timestamp and a message. at cluster, nodeA worker node is a machine that runs Kubernetes application workloads., podA pod is the smallest deployable Kubernetes unit and contains one or more containers., task, and service levels. A node is a worker machine; a pod groups running containers.
  4. For the documented Fluent Bit log path, deploy its DaemonSetA DaemonSet keeps a selected Kubernetes workload running on each eligible node., a Kubernetes controller that runs a collector on each eligible node. Fluent Bit is a log shipperA log shipper collects log records and forwards them to a destination. that forwards files and service journals to CloudWatch Logs.
Log groupA log group collects streams that share retention, monitoring, and access settings. suffix under /aws/containerinsights/Cluster_Name/ Source
application Files in /var/log/containers
host /var/log/dmesg, /var/log/secure, /var/log/messages
dataplane Journal logs for kubelet.service, kubeproxy.service, docker.service

Exam cues

  • If the question says inspect container resource pressure across workload layers, think Container Insights, because it collects container performance measurements and diagnostics.
  • If the question says new EKS deployment with PromQL queries, think OTel Container Insights, because its metrics use the Prometheus model.
  • If the question says ship EKS application and node log files, think Fluent Bit, because its DaemonSet forwards those logs to CloudWatch Logs.

Remember

  • OTel prerequisites: EKS 1.28+, add-on v6.2.0+.
  • Enhanced Container Insights Classic uses embedded metric formatEmbedded metric format places custom metric definitions and values inside structured log events. (EMF), structured logs carrying metric definitions. It receives security patches only.
  • The documented Fluent Bit setup reads new log entries from the tail by default. FluentBitReadFromHead=On includes existing contents.

Trap: Installing a log shipper does not imply it will replay every existing file. Check where collection starts.

Fluent Bit log delivery on EKS
collect1publish2EKS nodescontainer + node logsFluent BitDaemonSetCloudWatch Logsthree log groups
  1. Fluent Bit collects container files, host files, and node-service journals.

  2. Fluent Bit publishes to application, host, and dataplane log groups.

From the AWS docs (19)
  • Container Insights collects and summarizes metrics and logs for container workloads, including ECS and EKS.
  • Container Insights provides CPU, memory, disk, network, and container diagnostic information.
  • Classic Container Insights derives CloudWatch metrics at cluster, node, pod, task, and service levels from performance log events.
  • AWS recommends OTel Container Insights for new EKS deployments; it uses Prometheus metrics that can be queried with PromQL.
  • OTel Container Insights requires EKS 1.28 or later and amazon-cloudwatch-observability add-on v6.2.0 or later.
  • Enhanced Container Insights (Classic) is in maintenance mode with security patches only and uses CloudWatch-format EMF metrics.
  • The Container Insights EKS comparison lists CloudWatchAgentServerPolicy as a required IAM policy for both approaches.
  • The documented Fluent Bit setup runs as a DaemonSet to send container and node logs to CloudWatch Logs.
  • Fluent Bit sends files from /var/log/containers to /aws/containerinsights/Cluster_Name/application.
  • Fluent Bit sends host logs from /var/log/dmesg, /var/log/secure, and /var/log/messages to /aws/containerinsights/Cluster_Name/host.
  • Fluent Bit sends kubelet.service, kubeproxy.service, and docker.service journal logs to /aws/containerinsights/Cluster_Name/dataplane.
  • The documented Fluent Bit setup reads from the tail by default, collecting new log entries; FluentBitReadFromHead=On includes existing file contents.
  • OpenTelemetry is an open framework for collecting metrics, logs, and traces using instrumentation.
  • PromQL is the query language used to select and calculate results from Prometheus metrics.
  • A worker node is a machine that runs Kubernetes application workloads.
  • A pod is the smallest deployable Kubernetes unit and contains one or more containers.
  • A DaemonSet keeps a selected Kubernetes workload running on each eligible node.
  • A log shipper collects log records and forwards them to a destination.
  • Embedded metric format places custom metric definitions and values inside structured log events.

Subscription filters and central log delivery

A CloudWatch Logs subscription forwards matching new events to a processing destination. Cross-account delivery lets a security account receive events without polling every source accountA source account generates operational data and shares selected data with a monitoring account..

How it works

  1. The recipient creates a target such as Kinesis Data Streams or Firehose. A delivery roleAn IAM role is an identity with permissions that an authorized user, application, or service can assume. is the permission set CloudWatch Logs assumes to write to that target.
  2. The recipient creates a logical destinationA logical destination is a named receiving-account resource that senders reference for cross-account log delivery., an attachment point identified by an Amazon Resource NameAn Amazon Resource Name uniquely identifies an AWS resource. (ARN), and a destination access policy permitting senders.
  3. Each sender creates a subscription filterA subscription filter selects incoming log events and sends matches to a processing destination. pointing to that ARN. The log groupA log group collects streams that share retention, monitoring, and access settings. and logical destination must share a Region, although the target resource can be elsewhere.
  4. For direct cross-account Lambda delivery, grant the recipient role invocation rights and let CloudWatch Logs invoke the function. Create the logical destination and sender access policy before the sender filter.
  5. Process compressed batches and tolerate duplicates. Direct Lambda delivery uses awslogs.data; delivery through Kinesis uses the Kinesis event record structure.
  6. For an active log transformer, set applyOnTransformedLogs to match transformed rather than original events. Emit system fields to identify account, Region, and source log group, and use field selection criteria to select source accounts or Regions.

For automatic coverage, use an account-level subscription policy and selection criteria, rules choosing eligible log groups. Exclude log groups produced by the delivery workflow to prevent a loop. If a design needs per-group setup, an EventBridge rule can match CloudTrail API events using source: aws.logs, eventSource: logs.amazonaws.com, and eventName: CreateLogGroup, invoke Lambda, and call PutSubscriptionFilter for Firehose.

Exam cues

  • If the question says central security processing as events arrive, think subscription filters and a recipient destination, because the sources push matching events.
  • If the question says automatically include new log groups, think account-level subscription, because it covers eligible groups without a filter-creation function.
  • If the question says a function in another account must receive logs directly, think the documented Lambda logical destination, because cross-account Lambda delivery is supported with the required permissions.
  • If the question says search delivered logs in OpenSearch, think the CloudWatch Logs streaming integration, because it uses a Lambda subscription delivery path.
  • If Kinesis delivery throttles a busy log streamA log stream is a sequence of log events from the same source., think Random distribution, because the default groups records by log stream.
  • If creating a subscription to Kinesis fails authorization, check iam:PassRole. Restrict the delivery role trust with aws:SourceArn to reduce confused deputy risk.
  • If an organization needs central CloudWatch log groups across accounts and Regions, think centralization rules. Trusted access is required and only new events are copied.
  • If centralization to a customer managed KMS key fails, check key permissions and the LogsManaged=true tag. The rule can also exclude source groups encrypted with customer managed keys.
  • If subscription delivery is failing, monitor AWS/Logs metricsA metric is a sequence of measured values recorded over time. DeliveryErrors and DeliveryThrottling.
  • If the question says send only some log entries to a stream or function, think the subscription filter pattern, because only matching events are forwarded.

Remember

  • Standard class only; up to 5 filters per group and 1 account-level filter per Region.
  • Delivery is usually under 3 minutes. Retryable errors are retried up to 24 hours.
  • Delivery is at least once, meaning a consumer may see an event again.
  • Non-retryable errors can disable forwarding for up to 10 minutes and skip logs during that time.
  • The diagram shows a Kinesis-based path with Lambda processing and Firehose delivery to S3; direct Firehose and Lambda destinations are alternatives.

Trap: A subscription’s delivery role and destination access policy solve different permission checks. Permission to send to a destination does not give CloudWatch Logs permission to invoke or write to the target.

Trap: Subscribing the processing function’s own log group can feed its output back into the same workflow. Exclude delivery component groups.

Central log aggregation across accounts
Source accountsCentral log account (same Region)112345Log groupaccount A + filteriLog groupaccount B + filteriLogs destinationaccess policy + roleiKinesis streamData StreamsiLambdacustom processingiFirehosebuffer + deliveriS3 archivequery with Athenai
  1. Source subscriptions send matching new log events to the recipient logical destination.

  2. The destination role permits CloudWatch Logs to write into Kinesis Data Streams.

  3. A Lambda event source mapping can read Kinesis records for processing.

  4. Firehose can also read the Kinesis stream.

  5. Firehose buffers and delivers records to S3.

Box details (7)
Log group

The sender creates a subscription filter pointing to the recipient destination ARN. A Standard log group supports up to five subscription filters.

Log group

Each sender configures delivery to the recipient destination. An account-level subscription policy can cover eligible groups unless selection criteria exclude them.

Logs destination

The recipient creates the logical destination, its delivery role, and an access policy allowing the senders. The log group and logical destination must be in the same Region. The target resource may be in another Region.

Kinesis stream

This branch uses Kinesis Data Streams as the destination target. A logical destination can also point directly to Firehose or, with the documented permissions, Lambda.

Lambda

A Lambda event source mapping reads Kinesis records. The record data contains gzip-compressed subscription events; decode the Kinesis record data before decompressing. Direct Logs-to-Lambda subscriptions use awslogs.data.

Firehose

Firehose can read from Kinesis Data Streams and deliver buffered records to S3.

S3 archive

S3 stores delivered log batches for archival and analysis.

From the AWS docs (31)
  • Subscriptions deliver matching new CloudWatch log events to Kinesis Data Streams, Data Firehose, or Lambda for processing.
  • Subscriptions require Standard log class groups.
  • The CloudWatch Logs quota table allows up to 5 subscription filters per log group.
  • An account can have 1 account-level subscription filter per Region.
  • Subscription events are usually delivered less than 3 minutes after ingestion.
  • Subscription payloads use gzip compression and base64 encoding at their receiving interfaces.
  • Direct Lambda subscriptions carry the base64-encoded gzip payload in awslogs.data.
  • Subscriptions deliver at least once, so duplicate events can occur.
  • Retryable destination errors are retried for up to 24 hours.
  • Non-retryable destination errors can disable a subscription for up to 10 minutes, during which logs are skipped.
  • The cross-account recipient creates a target, a delivery role, a logical destination, and an access policy; senders reference the destination ARN in subscription filters.
  • The source log group and logical destination must share a Region; the destination target resource can be in a different Region.
  • Cross-account Lambda delivery uses a recipient role permitting invocation, Lambda invoke permission for CloudWatch Logs, a logical destination, and an access policy allowing senders.
  • An account-level subscription applies to all log groups unless selection criteria limit which groups are included.
  • Exclude log groups belonging to subscription delivery components to prevent recursive log delivery.
  • EventBridge can match CloudTrail-delivered CloudWatch Logs API events with source aws.logs, eventSource logs.amazonaws.com, and an eventName filter.
  • PutSubscriptionFilter creates or updates a filter for the named log group and destination.
  • An EventBridge rule can invoke Lambda as a target.
  • Lambda reads Kinesis records through an event source mapping whose records carry base64-encoded data.
  • Data Firehose can use Kinesis Data Streams as a source and deliver to S3.
  • CloudWatch Logs can stream log events to OpenSearch through a Lambda subscription delivery path.
  • Kinesis subscription delivery groups records by log stream by default; Random distribution spreads records more evenly and can reduce throttling.
  • For an active log transformer, applyOnTransformedLogs selects transformed events when true rather than the original ingested events.
  • Subscription filters can emit account, Region, and source log group system fields and select events by account and Region system fields.
  • PutSubscriptionFilter requires iam:PassRole for destinations other than Lambda.
  • A CloudWatch Logs delivery role trust policy can restrict role assumption with aws:SourceArn to reduce confused deputy risk.
  • CloudWatch Logs centralization rules replicate new log data across organization accounts and Regions into destination log groups; existing historical data is not copied.
  • CloudWatch Logs centralization requires source and destination accounts in the same AWS organization and trusted access for CloudWatch.
  • Centralization rules can exclude source groups encrypted with customer managed keys; destination customer managed keys require permission for CloudWatch Logs and the tag LogsManaged=true.
  • The AWS/Logs DeliveryErrors and DeliveryThrottling metrics count subscription delivery errors and throttled log events respectively.
  • A subscription filter forwards only the log events that match its filter pattern, so the pattern decides which entries the destination receives.

Cross-account observability

CloudWatch cross-account observability lets a monitoring accountA monitoring account views operational data shared by linked source accounts. investigate operational data from source accountsA source account generates operational data and shares selected data with a monitoring account. within a Region. Think of a sinkAn observability sink is the monitoring account attachment point for links from source accounts. as the monitoring account’s attachment point and a linkAn observability link is a source account resource that connects it to a monitoring account sink. as a source account’s connection to it.

How it works

  1. Create the monitoring account sink and authorize the source accounts or organization in its resource policy, the permission rules attached to that sink. Choose the telemetryTelemetry is operational data such as measurements, log events, and request traces. types, meaning operational measurements and events, it will accept. Sources can share metricsA metric is a sequence of measured values recorded over time., log groupsA log group collects streams that share retention, monitoring, and access settings., X-Ray traces, Application Signals services and SLOs, Application Insights applications, and Internet Monitor monitors.
  2. Create links from source accounts. A source cannot select types the monitoring account has not accepted. Use Organizations integration to onboard newly created organization accounts.
  3. In the monitoring account, run Logs Insights queries across shared log groups and create alarms on source metrics. Metric names appear only after new data points arrive following link creation.
  4. Distinguish this setup from the cross-account cross-Region console. That console uses CloudWatch-CrossAccountSharingRole in sharing accounts and combines remote metrics in dashboards, with the limitations below.
Requirement Mechanism Scope or limit
Query shared logs and investigate traces Cross-account observability Within a Region
Create alarms on shared source metrics Cross-account observability In the monitoring account
Display metrics across Regions Cross-account cross-Region console No cross-account cross-Region log visibility or alarm creation on remote metrics

Exam cues

  • If the question says investigate logs, metrics, and traces across accounts in one Region, think cross-account observability, because links share those signal types.
  • If the question says query several accounts’ log groups together, think Logs Insights in the monitoring account, because a query can span linked source groups.
  • If the question says one dashboard across accounts and Regions, think cross-account cross-Region console, because it combines remote metric views.

Remember

  • One sink per account per Region; a source can share with up to five monitoring accounts.
  • Source-selected telemetry types must be accepted by the monitoring account.
  • An account that is both source and monitor does not relay its sources’ data onward.
  • Cross-account observability adds no extra sharing cost for logs, metrics, or Application Signals; the first traceA trace records the work performed by application components to handle a request. copy is free.

Trap: The cross-account cross-Region console and cross-account observability have different capabilities. The console’s remote alarm restriction does not prevent observability monitoring accounts from creating alarms on shared source metrics within a Region.

Source links meet a monitoring account sink in one Region
SourcesMonitoring accountlink1linkshared view2Source Aobservability linkSource Bobservability linkSinkaccepted telemetryCloudWatchquery + alarm
  1. Sources link to the monitoring account sink with accepted telemetry types.

  2. The monitoring account queries shared log groups and alarms on shared source metrics.

From the AWS docs (17)
  • CloudWatch cross-account observability shares operational data between source and monitoring accounts within a Region.
  • Shared types include metrics, log groups, X-Ray traces, Application Signals services and SLOs, Application Insights applications, and Internet Monitor monitors.
  • A sink is the attachment point managed by a monitoring account.
  • A source account manages a link connecting it to a monitoring account sink.
  • Each account supports one sink per Region, and each source account can share with up to five monitoring accounts.
  • AWS recommends Organizations integration so newly created organization accounts are onboarded as sources.
  • Link creation fails if a source selects telemetry types the monitoring account does not accept.
  • An account acting as both source and monitor shares its own data onward but does not relay its sources data.
  • A linked metric name appears in the monitoring account console only after it emits new data points following link creation.
  • Cross-account observability adds no extra cost for logs, metrics, or Application Signals; the first trace copy is free.
  • A monitoring account can run one Logs Insights query across log groups in multiple source accounts.
  • A cross-account observability monitoring account can create alarms watching source-account metrics.
  • The cross-account cross-Region console supports dashboards combining metrics from multiple accounts and Regions.
  • The cross-account cross-Region console does not provide cross-account cross-Region log visibility or alarm creation on remote-account or remote-Region metrics.
  • Cross-account console sharing uses CloudWatch-CrossAccountSharingRole in sharing accounts.
  • Telemetry is operational data such as measurements, log events, and request traces.
  • A sink resource policy grants selected accounts or an organization permission to create links and can restrict shared resource types.

CloudWatch operational controls

CloudWatch operational controls help teams configure agents, manage alarm actions, and investigate logs. Their behavior matters when permissions, maintenance windows, or log retentionLog retention controls how long events remain eligible for storage before they expire. affect an operational response.

How it works

  1. Give the agent credentials through an EC2 instance profile or a shared credentials profile, including on premises. CloudWatchAgentServerPolicy permits publishing metricsA metric is a sequence of measured values recorded over time. and logs and reading AmazonCloudWatch-* parameters; CloudWatchAgentAdminPolicy also permits writing those parameters. The agent stores collected logs in CloudWatch Logs. See the credential options.
  2. Configure alarm actions and check their destinations. CloudWatch does not validate configured actions or detect errors when invoking nonexistent SNS topics or Auto Scaling actions. Most actions run on state changes, but Auto Scaling actions repeat every minute while the alarm remains in the relevant state. SetAlarmState forces a state only until the next comparison. See alarm actions.
  3. For a cross-account Lambda action, allow lambda.alarms.cloudwatch.amazonaws.com in the function resource policy and restrict the source accountA source account generates operational data and shares selected data with a monitoring account. and alarm ARNAn Amazon Resource Name uniquely identifies an AWS resource.. Creating a composite alarmA composite alarm evaluates a logical rule over the states of other alarms. requires cloudwatch:PutCompositeAlarm scoped to all resources; an IAM user also needs iam:CreateServiceLinkedRole for OpsItem actions. See Lambda actions and PutCompositeAlarm.
  4. During maintenance, choose a suppressor alarm for composite actions or a scheduled mute rule for targeted metric and composite alarms in the same account and Region. A suppressor in ALARM prevents composite actions, with wait and extension periodsA period is the time span over which metric values are combined into a statistic. around its transitions. A mute rule suppresses actions while evaluation continues.
  5. For logs, use Live Tail to filter and highlight newly ingested events during an incident. Use IncomingBytes by LogGroupName to identify groups ingesting the most data. For investigation, Logs Insights charges by data scanned and cannot read events timestamped before their log groupA log group collects streams that share retention, monitoring, and access settings. was created.

Exam cues

  • If a composite alarm remains silent during a deployment, think action suppression by a maintenance alarm, because a suppressor in ALARM prevents its actions.
  • If recurring maintenance must silence actions while evaluation continues, think scheduled mute rules. After the window, actions run only if the current state differs from the state at the start.
  • If composite alarms depend on each other and cannot be deleted, set one AlarmRule to False to break the cycle.
  • If expired events remain in a log group, think retention deletion delay, because marked events no longer incur archival storage charges while deletion is pending.
  • If a metric filterA metric filter turns matching incoming log events into numeric metric values. needs dimensionsA dimension is a name and value that identifies a particular variation of a metric. and a default value, choose the dimensions without a default, because the two cannot be combined.

Remember

  • A composite rule can reference up to 100 alarms; one alarm can be referenced by up to 150 composites.
  • AWS recommends 60 seconds each for the suppressor wait and extension periods.
  • Alarms with 10, 20, or 30 second periods evaluate every 10 seconds. See evaluation settings.
  • Expired log eventsA log event records an activity as a timestamp and a message. are marked for deletion. Deletion normally takes up to 72 hours and can rarely take longer.
  • Logs Insights supports Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. Queries time out after 60 minutes; results remain available for 7 days.
  • Live Tail sessions are billed per minute.
  • Custom metrics published per server stay separate; omitting a dimension does not aggregate them.
  • PutMetricData accepts data points up to two weeks old.

Trap: An alarm action is not guaranteed to work just because it is configured. CloudWatch does not validate the destination; check that an SNS topic or Auto Scaling action exists.

From the AWS docs (27)
  • CloudWatchAgentServerPolicy grants metric and log publishing permissions and GetParameter access to AmazonCloudWatch-* parameters.
  • CloudWatchAgentAdminPolicy also grants PutParameter access to AmazonCloudWatch-* parameters for configuration management.
  • The agent supports EC2 instance profile credentials and shared AWS credential profiles, including for on-premises installations.
  • Logs collected by the CloudWatch agent are stored in CloudWatch Logs, like logs from the older CloudWatch Logs agent.
  • Alarm actions normally run on state changes; Auto Scaling actions repeat once per minute while the alarm stays in the relevant state.
  • A suppressor alarm in ALARM prevents composite alarm actions; WaitPeriod and ExtensionPeriod delay actions around suppressor transitions. AWS recommends 60 seconds for each.
  • Cyclic composite alarm dependencies stop evaluation and prevent deletion; setting one AlarmRule to False breaks the cycle.
  • CloudWatch does not validate configured alarm actions or detect errors from attempts to invoke nonexistent EC2 Auto Scaling actions or SNS topics.
  • SetAlarmState temporarily changes an alarm state until the next alarm comparison.
  • Lambda alarm actions can invoke a function in another account; its resource policy must allow lambda.alarms.cloudwatch.amazonaws.com to invoke it, with source account and alarm ARN restrictions.
  • Creating a composite alarm requires cloudwatch:PutCompositeAlarm scoped to all resources; an IAM user creating one with OpsItem actions also needs iam:CreateServiceLinkedRole.
  • A composite rule can reference up to 100 alarms, and a single alarm can be referenced by up to 150 composite alarms.
  • Scheduled alarm mute rules suppress actions but not state evaluation for targeted metric and composite alarms in the same account and Region.
  • After a mute window ends, CloudWatch executes actions for the current state if it differs from the state at the start; otherwise it executes no actions.
  • Alarms with 10-, 20-, or 30-second periods evaluate every 10 seconds.
  • Log events older than the applicable retention period are marked for deletion.
  • Deletion normally takes up to 72 hours after expiry and can rarely take longer; marked events no longer incur archival storage charges.
  • The AWS/Logs metric IncomingBytes, by LogGroupName, shows how much data each log group ingests, which finds the costliest groups.
  • CloudWatch Logs Live Tail streams new log events as they are ingested so you can filter and highlight them in near real time during an incident; sessions are billed per minute.
  • Supported query languages are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL.
  • Queries in any supported language time out after 60 minutes.
  • Query results remain available for 7 days.
  • Logs Insights charges depend on data scanned regardless of query language.
  • Logs Insights cannot read events whose timestamps precede creation of their log group.
  • Metric filters with dimensions cannot have a default value.
  • CloudWatch does not automatically aggregate traditional custom metrics across different dimension combinations.
  • PutMetricData accepts data point timestamps up to two weeks in the past and up to two hours in the future.

Flashcards

tap to flip
Answer

·

All 124 cards as a list

How can Amazon CloudWatch support data governance through logging?

It collects, stores and queries logs.

Which AWS service collects and searches application log files from EC2 instances?

Amazon CloudWatch Logs, with the CloudWatch agent installed on the instances.

Does Amazon CloudWatch tell you which user changed a security group?

No. That is AWS CloudTrail. CloudWatch watches metrics, logs and alarms about performance and health.

A company wants an email when its estimated AWS charges pass 500 USD, using CloudWatch. What does it set up, and in which Region?

A CloudWatch billing alarm on EstimatedCharges with an SNS notification, created in US East (N. Virginia) after turning on billing alerts.

Which AWS service monitors resource utilization, application performance and operational health of AWS resources?

Amazon CloudWatch.

What identifies a traditional CloudWatch metric, and what does a new dimension value do?

Namespace, metric name, and dimensions identify it. A new dimension combination creates a separate metric. The limit is 30 dimensions, and custom metrics are not automatically aggregated across combinations.

Which resolutions can traditional CloudWatch custom metrics use, and which sub-minute alarm periods are supported?

Standard resolution is 60 seconds; high resolution is 1 second with StorageResolution=1. High-resolution alarms support 10, 20, or 30 seconds at a higher charge.

How long does CloudWatch retain traditional metric data at each granularity?

Sub-minute: 3 hours. One minute: 15 days. Five minutes: 63 days. One hour: 455 days. Older data is aggregated before it finally expires.

An EC2 fleet uses basic monitoring, but its CloudWatch CPU alarm needs fresh data each minute. What should change?

Enable detailed monitoring. Basic CPU metrics use 5-minute periods; detailed monitoring provides 1-minute metrics for an additional charge. Status checks already use 1-minute periods with basic monitoring.

An application has an acceptable average latency in CloudWatch, but some users report slow requests. Which statistic should operators examine?

A high percentile such as p95. It shows the slower end of the latency distribution that an average can hide.

A team wants an SNS alert when an AWS service usage metric passes 80 percent of its service quota. How can CloudWatch do this?

Graph the usage metric, add the metric math expression m1/SERVICE_QUOTA(m1)*100, and create an alarm on it with a threshold of 80 that notifies the SNS topic.

An EC2 application needs memory use, disk space use, and application log files in CloudWatch. What should operators install?

The CloudWatch agent, with publishing permissions such as CloudWatchAgentServerPolicy on the instance role. Configure the guest metrics and file paths; traditional agent metrics use CWAgent by default.

A Lambda function must publish CloudWatch custom metrics from its logs without making PutMetricData calls. What fits?

Embedded metric format. CloudWatch extracts custom metrics asynchronously from the structured log events. Avoid request IDs as dimensions because each dimension combination creates a custom metric.

A team wants centrally managed CloudWatch agent configuration across many servers. Where can it store the configuration?

Systems Manager Parameter Store. Use Systems Manager to install and manage the agent, with permissions to read its configuration.

A Lambda team needs request IDs for investigations but wants to avoid a separate CloudWatch metric for each request. How should it use embedded metric format?

Keep request IDs as log details and use stable dimensions for metrics. Embedded metric format creates a metric for every distinct dimension combination.

EC2 instances fail for lack of swap space. How do you monitor available swap on each instance?

Install the CloudWatch agent and collect its swap metrics (for example swap_used_percent); EC2 does not report swap by default.

A team needs memory and CPU usage plus cold-start data for its Lambda functions in CloudWatch. What should it enable?

Lambda Insights, the CloudWatch extension delivered as a Lambda layer.

A CloudWatch metric alarm uses Datapoints to Alarm=3 and Evaluation Periods=5. With all data present, when does it enter ALARM?

When at least 3 of the 5 recent datapoints breach. They need not be consecutive. For periods of at least 1 minute, evaluation normally happens every minute; intervals longer than 1 day evaluate hourly.

What are the four CloudWatch alarm missing-data settings and the default?

missing is the default and gives INSUFFICIENT_DATA when all data is absent. notBreaching treats gaps as good; breaching treats them as bad; ignore retains the state. CloudWatch fills gaps only when it lacks enough real points.

A CloudWatch application error-count metric emits data only when errors occur. Which missing-data setting fits?

notBreaching, because no error data should not imply a fault. For a continually reporting heartbeat, breaching can be appropriate. For EC2 stop, terminate, reboot, or recover alarms, AWS recommends missing.

A CloudWatch application heartbeat must report continuously. How can an alarm detect loss of the heartbeat?

Treat missing data as breaching. This makes absent expected health telemetry count toward the alarm condition.

Several related CloudWatch alarms page the same team. Which alarm type can combine their conditions into one notification?

A composite alarm. Its rule tests the states of other alarms with operators such as AND, OR, and NOT, so the team can notify from the combined condition.

Can a CloudWatch composite alarm recover an EC2 instance or execute an Auto Scaling policy?

No. Use a metric alarm for EC2 or Auto Scaling actions. A composite can notify SNS, invoke Lambda, use supported Systems Manager actions, or start an investigation.

A team needs one notification from related CloudWatch alarms and automatic EC2 recovery. How should it configure actions?

Use a composite alarm for the combined notification and a metric alarm for EC2 recovery. Composite alarms cannot perform the recovery action.

What can react automatically to a CloudWatch alarm state change?

Configure alarm actions such as SNS, Lambda, EC2, Auto Scaling, or Systems Manager. An EventBridge rule can also route the state-change event. Use StatusCheckFailed_System for a system-failure recovery alarm.

An EC2 guest operating system fails its instance status check. Should a CloudWatch alarm use reboot or system recovery?

Reboot is the appropriate instance-check action. System recovery addresses underlying host failures monitored by StatusCheckFailed_System.

A CloudWatch CPU alarm fires falsely during predictable daily traffic peaks. What feature fits better?

An anomaly detection alarm. It models hourly, daily, and weekly patterns from up to 2 weeks of history and compares the measurement with an expected band.

A deployment creates unusual CloudWatch measurements that should not define normal application behavior. What should operators change in anomaly detection?

Exclude the deployment interval from model training. The model can then learn expected behavior without that unusual interval.

Does a CloudWatch metric need a full 2 weeks of history before anomaly detection can be enabled?

No. CloudWatch trains on up to 2 weeks but permits enabling detection with less history.

A CloudWatch anomaly band is too narrow for expected variation. Which setting widens it?

Increase the anomaly detection threshold. A higher value produces a wider expected band.

What is the difference between a CloudWatch Logs log stream and a log group?

A stream holds events from one source. A group holds streams with common retention, monitoring, and access settings. A group has no limit on its number of streams.

A fleet writes application logs to separate CloudWatch streams but requires the same retention and access settings. How should operators organize the streams?

Put the streams in one log group. Retention, monitoring, and access settings are shared at the group level.

A CloudWatch log group has long retention, but an applicable account-level policy specifies shorter retention. Which setting applies?

The account-level retention policy overrides the group setting. If several account policies overlap, the longest applicable account policy wins.

An organization wants an account-level CloudWatch retention policy to affect existing matching log groups. Which enforcement mode fits?

RETROACTIVE. NEW_ONLY applies only to log groups created after the policy.

A team wants to cut ingestion cost for logs it only keeps for occasional cross-account analysis. Which log class fits, and can an existing log group switch to it?

The Essentials log class (formerly Infrequent Access), which has a lower ingestion price and fewer features. A log group's class is fixed at creation, so it needs a new log group.

A CloudWatch Logs design needs Live Tail and subscription filters. Can it use the cheaper Essentials log class?

Use Standard. Essentials, formerly Infrequent Access, does not support Live Tail or subscription filters.

EC2 instances in private subnets with no internet access must send logs to Amazon CloudWatch Logs. What should the VPC add?

An interface VPC endpoint for CloudWatch Logs (AWS PrivateLink).

An application sends ERROR log events to CloudWatch Logs. How can the team alarm on the error count?

Create a metric filter on the Standard log group with a matching pattern and metric value 1, then alarm on that metric. Default 0 covers ingested logs with no matches, but not minutes without ingestion.

A team needs a CloudWatch alarm when newly ingested JSON logs contain numeric status 500. What filter pattern fits?

Use { $.status = 500 } in a metric filter, then alarm on the resulting metric. It starts counting after filter creation and does not backfill stored events.

A CloudWatch Logs metric filter has default value 0, but the application sends no logs for a minute. Does the filter publish zero?

No. A default applies when logs arrive but none match. A minute with no ingestion produces no value.

A metric filter should add a dimension for each request ID. Is this a good idea?

No. Metric filters allow up to three dimensions, and each distinct value is charged like a custom metric, so high-cardinality fields such as request IDs drive up cost.

A team wants the error count in CloudWatch logs from last week. Will a newly created metric filter count those stored events?

No. Query the stored events with Logs Insights. Metric filters start publishing only for events after filter creation.

CloudWatch Logs Insights investigations scan too much data. What can reduce the scan volume?

Create field indexes for frequently queried fields and limit the groups and time range being investigated. Indexes let Logs Insights skip irrelevant data.

A team needs a CloudWatch Logs Insights query to run regularly and save results in Amazon S3. What feature fits?

Use a scheduled query with an S3 destination.

A team must find which EC2 instance produces the most error log lines and alarm when one instance causes over half of them. What fits?

A CloudWatch Contributor Insights rule on the logs, plus an alarm on INSIGHT_RULE_METRIC comparing the top contributor with the total.

A team wants CloudWatch Logs to find unusual log patterns without writing a rule for each error. Which feature fits?

Log anomaly detection. Use a detector for continuous monitoring or a Logs Insights anomaly detection query for an investigation.

What key and policy does a CloudWatch Logs group need for customer managed KMS encryption?

A symmetric KMS key whose policy permits the regional logs.<region>.amazonaws.com service principal. Associate it with the log group; newly ingested data uses it. Disabled or deleted keys make their encrypted logs unreadable.

A CloudWatch Logs group already exists. How can operators associate a KMS key and restrict it to that group?

Use the CLI or API, such as associate-kms-key; the console cannot associate a key with an existing group. Scope key use with kms:EncryptionContext:aws:logs:arn. Allow up to 5 minutes for the change.

An application already sends sensitive fields to CloudWatch Logs. How can operators mask them in future query and subscription output without changing application code?

Apply a data protection policy. It detects selected data at ingestion and masks it at egress. logs:Unmask permits viewing originals. Events ingested before the policy remain unmasked.

A security requirement says sensitive log fields must be encrypted before leaving the application. Does CloudWatch log group KMS encryption satisfy it?

No. Use client-side encryption such as the AWS Encryption SDK before sending data. Envelope encryption encrypts the payload with a data key and includes encrypted copies of that key. Server-side log group encryption starts after receipt.

An operator associates a customer managed KMS key with a CloudWatch log group. Does it re-encrypt historical events?

No. Only newly ingested data uses the associated key. Association can take up to 5 minutes. Keep older keys available for data already encrypted with them.

A team disassociates its KMS key from CloudWatch Logs and then disables the key. Can it still read older logs encrypted under that key?

No. Disassociation does not re-encrypt existing data. CloudWatch still needs access to the old key to decrypt those logs.

A team needs long-term CloudWatch log archives in S3 that it can query. Which paths fit batch and continuous delivery?

Use CreateExportTask for a selected historical range, or a subscription to Firehose for continuous S3 delivery. Apply S3 lifecycle rules and use an Athena table to query the exported logs.

Is a CloudWatch Logs export task a near-real-time delivery mechanism to S3?

No. Logs can take up to 12 hours to become exportable, and tasks run in batches. Use a subscription to Firehose for continuous archival. SSE-KMS buckets are supported; DSSE-KMS buckets are not.

A CloudWatch Logs export must write to a security account S3 bucket in another Region. Will that export task work?

No. Cross-account export is supported, but the bucket must share the source log Region.

A CloudWatch Logs S3 export times out on a large historical range. What adjustment does AWS recommend?

Reduce the time range and export smaller batches. Export tasks time out after 24 hours.

A team needs a CloudWatch dashboard showing CPU, an alarm state, and recent log error counts. How can it build one?

Use a metric graph and an alarm widget. Run a Logs Insights aggregation and choose Add to dashboard for a log query widget.

Are CloudWatch dashboards Regional, and how does PutDashboard update an existing dashboard?

Dashboards are global within an account. PutDashboard replaces the complete dashboard contents with the supplied JSON DashboardBody.

A CloudWatch dashboard with Logs Insights widgets refreshes frequently and query usage rises. What should operators change?

Reduce refresh frequency and narrow the queried groups and time range. Each dashboard load or refresh starts its log queries again.

An EC2 fleet changes often and a CloudWatch dashboard must follow instances with a specific environment tag. Which widget fits?

A metrics explorer widget. It follows matching tags or resource properties as resources are created or deleted.

Which CloudWatch mechanism continuously exports metric updates to S3 or another analytics destination?

A metric stream through Data Firehose. Custom Firehose, quick S3, and supported partner setup workflows are available.

A company needs CloudWatch metrics continuously delivered to an external monitoring endpoint without polling. Which path fits?

CloudWatch metric stream to Data Firehose and a supported destination. Delivery latency depends on Firehose buffering; linked source-account metrics can be included by a monitoring account.

How can a CloudWatch metric stream select metrics, and which output formats are supported?

Use up to 1000 include filters or exclude filters, but not both modes. Formats are JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0. New matching metrics are included automatically.

A CloudWatch metric stream is Running but its destination receives no data. Can its filters explain this?

Yes. Running does not mean matching metrics exist. Check whether the selected namespaces and metrics have data matching the filters.

A CloudWatch metric stream cannot write to its Firehose stream. Which role settings should operators inspect?

Trust for streams.metrics.cloudwatch.amazonaws.com and permissions for firehose:PutRecord and firehose:PutRecordBatch on the delivery stream.

A team must detect a broken checkout flow before customers encounter it. Which CloudWatch feature should it use?

A Synthetics canary that scripts the checkout actions. Canaries run without customer traffic and publish SuccessPercent and Duration metrics in CloudWatchSynthetics.

A team must test a login page while there are no customer sessions. Should it use CloudWatch RUM or Synthetics?

Synthetics. Its canary runs a scripted check independently of customer traffic. RUM observes actual user sessions.

After a deployment, a CloudWatch Synthetics canary fails. What evidence can help diagnose the failure?

Inspect the failed steps, screenshots, HAR files, logs, and SuccessPercent, and compare them with a successful run.

A release changes a web layout unexpectedly while HTTP requests still succeed. Which CloudWatch Synthetics check detects this?

Visual monitoring using a supported Puppeteer runtime. It compares screenshots with a baseline and fails when the difference exceeds the configured percentage.

A CloudWatch Synthetics checkout canary fails after an application release. Which evidence helps isolate the failed operation?

Inspect the failed run steps, screenshots, HAR request details, and logs; compare them with a successful run. Logs are available in S3 and CloudWatch Logs.

A team needs to detect a broken API flow after deployment without waiting for customers. Which CloudWatch feature fits?

Use a Synthetics API canary to run scripted checks, including multiple API calls.

What does CloudWatch RUM measure that a Synthetics canary does not directly measure?

The experience of actual user sessions, including page load times, client-side errors, and user behavior. Canaries generate scheduled checks independently of customer traffic.

A web team sees slow page loads on a particular browser and device type and needs evidence from real users. Which CloudWatch feature fits?

CloudWatch RUM. Instrument the web application with its app-monitor client and inspect performance data by usage characteristics.

A team needs CloudWatch RUM telemetry beyond its built-in retention. What should it configure?

Enable copies to CloudWatch Logs and set that log group retention appropriately. RUM itself deletes end-user data after 30 days.

What session sampling percentage does the CloudWatch RUM web app monitor creation workflow use by default?

100%. Reduce it to collect fewer sessions and reduce charges.

Which CloudWatch Container Insights approach does AWS recommend for a new EKS cluster?

OTel Container Insights. It uses PromQL-queryable metrics and requires EKS 1.28+ and amazon-cloudwatch-observability add-on v6.2.0+.

Which log groups does the documented CloudWatch Fluent Bit setup use for EKS application, host, and node-service logs?

/aws/containerinsights/Cluster_Name/application, /host, and /dataplane. Application logs come from /var/log/containers; dataplane logs include kubelet service journals.

An EKS team deployed the documented CloudWatch Fluent Bit DaemonSet but cannot find older entries already in the log files. What explains this?

The setup reads from the tail by default. Set FluentBitReadFromHead=On to collect existing file contents.

An EKS team needs PromQL dashboards but uses Enhanced Container Insights Classic metrics. Which migration target fits?

OTel Container Insights. Classic uses CloudWatch-format EMF metrics and receives security patches only; OTel supports PromQL.

What are the CloudWatch Logs subscription filter limits and delivery guarantees?

Up to 5 filters per Standard log group and 1 account-level filter per Region. Delivery is usually within 3 minutes, uses gzip, and is at least once. Retryable errors are retried for up to 24 hours.

Several AWS accounts must stream CloudWatch logs to a security account. What does each side configure?

The recipient creates the target, delivery role, logical destination, and destination access policy. Senders create subscription filters referencing the destination ARN. The source group and logical destination share a Region.

A security account needs matching CloudWatch log events from other accounts as they arrive. What delivery configuration fits?

Cross-account subscription filters to a recipient logical destination. The destination access policy authorizes senders, and the delivery role authorizes writing to the target.

A security team needs central near-real-time analysis of CloudWatch logs from many accounts. Which ingestion path fits?

Source subscription filters to a security-account logical destination backed by Kinesis Data Streams or Firehose. Consumers can analyze the delivered events; subscriptions use gzip and may deliver duplicates.

Which CloudWatch feature forwards new log events to another processing system, and how does direct Lambda delivery encode them?

A subscription filter. Targets include Kinesis Data Streams, Firehose, and Lambda. Direct Lambda subscriptions carry base64-encoded gzip data in awslogs.data.

A company wants every eligible current and future CloudWatch log group in an account to forward logs without per-group automation. What should it configure?

An account-level subscription policy. Without selection criteria it covers all eligible log groups; exclude delivery component log groups to prevent recursion.

A central Lambda function must process CloudWatch logs from another account directly. Is a cross-account Lambda subscription destination supported?

Yes. Configure the recipient invocation role, Lambda permission, logical destination, and destination access policy, then point the sender filter at that destination.

A team uses per-group CloudWatch log subscriptions and must attach a Firehose filter when a group is created. How can it automate that?

Match the CloudTrail-delivered CreateLogGroup API event in EventBridge, invoke Lambda, and have the function call PutSubscriptionFilter for the new group and Firehose destination. An account-level policy can avoid this per-group workflow.

A CloudWatch Logs subscription retries delivery to a consumer. What must the consumer tolerate?

Duplicate events. Subscription delivery is at least once, and retryable failures are retried for up to 24 hours.

A CloudWatch Logs subscription sends through Kinesis to Lambda. Should the function expect the direct-subscription awslogs.data envelope?

No. The function receives Kinesis records through its event source mapping. Decode each record data value and then decompress the subscription payload. awslogs.data belongs to direct Logs-to-Lambda delivery.

A CloudWatch Logs subscription throttles a Kinesis Data Streams destination on a busy log stream. Which distribution option can spread writes more evenly?

Set distribution to Random. The default groups records by log stream, which can concentrate writes.

A CloudWatch Logs subscription must match fields produced by an active log transformer. Which setting selects those fields?

Set applyOnTransformedLogs to true. The filter then uses transformed rather than original events.

A central CloudWatch Logs subscription must identify and select events by their original account and Region. Which subscription options help?

Emit the source system fields and use fieldSelectionCriteria to select account and Region values.

An engineer creates a CloudWatch Logs subscription to Kinesis Data Streams. What permission and role trust restriction are relevant?

The caller needs iam:PassRole. Restrict the CloudWatch Logs delivery role trust with aws:SourceArn.

An organization needs CloudWatch log groups copied across accounts and Regions into central CloudWatch log groups. Which feature applies and does it copy historical events?

Use CloudWatch Logs centralization rules with trusted access. Only new events after rule creation are copied; historical events are not.

A CloudWatch Logs centralization rule fails to deliver to a destination encrypted with a customer managed KMS key. What key configuration should the team check?

Check that the key permits CloudWatch Logs and has the LogsManaged=true tag. Also check whether the rule excludes source log groups encrypted with customer managed keys.

A team needs to detect throttling and errors forwarding CloudWatch Logs subscriptions to Firehose. Which CloudWatch metrics should it monitor?

Monitor AWS/Logs DeliveryThrottling for throttled events and DeliveryErrors for delivery errors.

A CloudWatch Logs log group must stream entries to another service, but entries containing personal data must not be delivered. Where is the selection made?

In the subscription filter pattern. CloudWatch Logs forwards only events that match it, so a pattern that matches only the wanted entries keeps the others out of the destination.

A company needs one account to investigate CloudWatch metrics, logs, and traces from several accounts within a Region. Which setup fits?

CloudWatch cross-account observability. The monitoring account creates a sink and a policy authorizing sources; source accounts create links. Organizations integration includes newly created organization accounts.

What can the CloudWatch cross-account cross-Region console provide, and what are its limits?

Dashboards combining metrics across accounts and Regions, using CloudWatch-CrossAccountSharingRole in sharing accounts. This console feature does not supply cross-account cross-Region log visibility or create alarms on remote metrics.

Operators need a single CloudWatch Logs Insights query across log groups in several accounts in one Region. What should they configure?

CloudWatch cross-account observability with shared log groups. Run the query in the monitoring account against the linked source groups.

A CloudWatch cross-account observability source requests a telemetry type not accepted by the monitoring account. What happens?

Link creation fails. The source must select only accepted types. Each account has one sink per Region, and a source can share with up to five monitoring accounts.

A source metric is absent from the CloudWatch monitoring account console immediately after an observability link is created. What should operators check?

Whether it emitted a new data point after link creation. A metric name does not appear until that happens.

A CloudWatch cross-account observability monitoring account is also linked as a source to another monitor. Does it relay all linked source data?

No. It shares only its own data onward. Cross-account observability links do not relay telemetry from upstream source accounts.

How do CloudWatchAgentServerPolicy and CloudWatchAgentAdminPolicy differ for agent configuration in Parameter Store?

ServerPolicy can read AmazonCloudWatch-* parameters and publish telemetry. AdminPolicy also writes those parameters. EC2 can use instance profile credentials; on-premises agents can use a shared credential profile.

An application on EC2 writes log files that must end up in Amazon Data Firehose. Can the CloudWatch agent deliver them straight to Firehose?

No. The agent stores the logs it collects in CloudWatch Logs. Deliver them onward with a subscription filter on the log group.

A CloudWatch alarm stays in ALARM after invoking an Auto Scaling action. Can it invoke the action again without another state change?

Yes. Auto Scaling actions repeat once per minute while the alarm remains in the relevant state. Most other alarm actions run on state changes.

During a deployment, a team wants a CloudWatch composite alarm to retain its state but suppress SNS actions while a maintenance alarm is in ALARM. What should it configure?

Use the maintenance alarm as an action suppressor. Configure wait and extension periods around its transitions; AWS recommends 60 seconds for each.

Two CloudWatch composite alarms depend on each other and cannot be deleted. How can an operator restore evaluation and remove the dependency?

Set one composite alarm's AlarmRule to False to break the dependency cycle.

A CloudWatch alarm transitions to ALARM but its configured SNS topic does not exist. Does CloudWatch validate the action when the alarm is configured?

No. CloudWatch does not validate the action or detect errors from attempts to invoke nonexistent SNS or Auto Scaling actions.

An operator tests a CloudWatch alarm action with SetAlarmState. Does the forced state persist?

No. It is temporary and lasts until the next alarm comparison.

A CloudWatch alarm must invoke a Lambda function in another AWS account. What permission must the function resource policy grant?

Allow lambda.alarms.cloudwatch.amazonaws.com to invoke the function. Restrict the source account and alarm ARN.

An IAM user cannot create a CloudWatch composite alarm with a Systems Manager OpsItem action. Which permissions should be checked?

Grant cloudwatch:PutCompositeAlarm scoped to all resources and iam:CreateServiceLinkedRole.

A CloudWatch composite alarm must combine more than 100 underlying alarms. Can one composite rule reference all of them?

No. A composite rule can reference up to 100 alarms.

A team wants to silence CloudWatch metric and composite alarm actions during a recurring maintenance window while keeping state evaluation active. What should it configure?

A scheduled alarm mute rule targeting alarms in the same account and Region.

A CloudWatch alarm changes state during a mute window and is still in that new state when the window ends. What happens to its actions?

CloudWatch executes the current state's actions if the final state differs from the state at the start of the window.

A CloudWatch alarm has a 30-second period. Does it wait 30 seconds between evaluations?

No. Alarms with 10-, 20-, or 30-second periods evaluate every 10 seconds. The period and evaluation cadence are different settings.

CloudWatch log events have expired but have not been physically deleted. Are they still charged as archival storage?

No. Events marked for deletion no longer add archival storage charges. Physical deletion normally takes up to 72 hours and can occasionally take longer.

Which CloudWatch metric shows which log groups ingest the most data and drive the CloudWatch Logs bill?

AWS/Logs IncomingBytes, with the LogGroupName dimension.

During an incident, an engineer wants to watch new log events appear and filter them for an error string. Which CloudWatch feature fits?

CloudWatch Logs Live Tail, which streams newly ingested events with filtering and highlighting.

Which query languages does CloudWatch Logs Insights support, and how long do queries and results last?

Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. Queries time out after 60 minutes; results remain for 7 days. Charges depend on data scanned.

Can CloudWatch Logs Insights query events whose timestamps are older than their log group creation time?

No. Those timestamps are outside the events Logs Insights can access for that group.

A team wants a CloudWatch Logs metric filter with service dimensions and a default value of zero. Can it configure both?

No. A metric filter with dimensions cannot specify a default value. Choose the dimension design and alarm missing-data behavior accordingly.

A team publishes a traditional CloudWatch custom metric separately for each server. Will omitting the server dimension automatically return a fleet aggregate?

No. Publish the required aggregate or calculate it explicitly. Traditional custom metrics do not automatically aggregate across dimension combinations.

A batch job wants to backfill custom metric data points from three weeks ago with PutMetricData. Will CloudWatch accept them?

No. PutMetricData accepts timestamps up to two weeks back and up to two hours ahead.

You finished every topic of DOP-C02!

Your badge turned gold. Next step: book the exam on AWS. Once you pass, add yourself to Who passed.

Share

Share that you finished this certification

I finished every topic of AWS Certified DevOps Engineer - Professional (DOP-C02) on Easy Review. Come study too!