CloudWatch Metrics, Alarms, and Log Filters for SOA-C03
Amazon CloudWatch is the monitoring and logging backbone of AWS operations: it collects metrics, ingests logs, and raises alarms for every workload you run. Task 1.1 of the SOA-C03 exam tests whether you can wire that telemetry correctly — choose the right metric resolution, run the CloudWatch agent across EC2 fleets and container clusters, monitor serverless and AI workloads, turn log patterns into alarmable metrics, design alarms that act directly or through Amazon EventBridge, and make sure the Amazon SNS notification actually arrives. It also expects you to keep CloudWatch and AWS CloudTrail straight — performance telemetry versus an audit trail of API calls — and to build dashboards that span accounts and Regions. This lesson covers all five skills in the task, including the failure modes questions are built on: missing memory metrics, alarms stuck in INSUFFICIENT_DATA, alarm actions that silently fail, and notifications that never arrive.
What you’ll learn
- Distinguish standard, detailed, and high-resolution metrics, and pair high-resolution metrics with 10- or 30-second alarms
- Install, configure, and permission the CloudWatch agent across an EC2 fleet with Systems Manager and Parameter Store
- Choose the right collector for containers: Container Insights on ECS (Fargate and EC2) and EKS, or Amazon Managed Service for Prometheus
- Monitor serverless and AI workloads with built-in Lambda metrics, Lambda Insights, and Amazon Bedrock metrics and invocation logging
- Create metric filters, subscription filters (including cross-account), Logs Insights queries, and Live Tail sessions for the right job
- Design alarms with evaluation periods, datapoints-to-alarm, missing-data handling, and composite logic
- Know which actions metric and composite alarms invoke directly and which need EventBridge, and fix the permissions each one needs
- Wire SNS notifications that survive encryption and service-publisher policies, and share dashboards across accounts, Regions, and people
- Separate CloudTrail's API-audit role from CloudWatch's performance telemetry, including event history, trails, and Insights events
The 11 parts · about 19 min of reading
- CloudWatch metricsStart hereA metric is a namespace, name and dimension set; any mismatch means no data, and resolution decides how fast alarms can react.2 min
- What EC2 doesn't tell youMemory, disk space and processes need the CloudWatch agent, ideally configured fleet-wide from Parameter Store with the right role policy.2 min
- Containers: Container Insights on ECS and EKS, and Managed PrometheusHow Container Insights is switched on for ECS on Fargate, ECS on EC2 and EKS, and when Managed Prometheus fits instead.2 min
- Serverless and AI workloadsWhich built-in Lambda and Bedrock metrics answer which question, and what Lambda Insights and invocation logging add.2 min
- CloudWatch LogsRetention and log class are set per log group, and Logs Insights queries history while Live Tail watches events as they arrive.2 min
- Metric filtersA metric filter counts log matches into an alarmable metric, while a subscription filter streams the events, even across accounts.2 min
- CloudTrail for operatorsCloudTrail answers who called which API: 90 days of event history by default, a trail for longer, and metric filters to alert on it.2 min
- Alarm anatomyAlarm states, the period and M out of N settings, and the four treat-missing-data options that decide what a gap means.1 min
- Alarm actions and composite alarmsWhich actions an alarm runs natively, which need EventBridge, the Lambda permission, and composite alarms that cut paging noise.2 min
- SNS wiringThree links must hold for a notification to arrive: a live subscription, a topic policy for the publisher, and a usable KMS key.1 min
- Dashboards across accounts and RegionsPer-widget Regions, cross-account observability with Regional sinks and links, and the four ways to share a dashboard.1 min
Mind map
How the exam tests this
Scenarios hinge on one detail. "Memory or disk-space metrics are missing" points to the CloudWatch agent; a whole fleet with one place to change the configuration points to Parameter Store plus the Systems Manager agent documents, and agent publishing errors point to a missing CloudWatchAgentServerPolicy. Container questions turn on the platform: Fargate needs only the cluster setting, existing ECS clusters are not changed by the account setting, EKS uses the CloudWatch Observability add-on. Serverless and AI items separate Lambda Throttles from Errors and ConcurrentExecutions, Lambda Insights from built-in metrics, and Bedrock metrics from model invocation logging. Log items separate metric filters (alarm on Sum, default value 0, no backfill), subscription filters (including cross-account destinations), Logs Insights (history) and Live Tail (now). Alarm items probe M-out-of-N, treat-missing-data, which actions metric and composite alarms take directly versus through EventBridge, and the permissions that make an action or notification actually work — the Lambda resource policy, SNS topic policies, and a customer managed key on encrypted topics. Audit items test CloudTrail event history versus trails, and dashboard items test Regional cross-account links and the sharing options.
Key takeaways
- Default EC2 metrics never include memory or disk-space utilization — collecting those (and process counts via procstat) requires the CloudWatch agent.
- Run the agent at fleet scale with one Parameter Store configuration (AmazonCloudWatch-*), AWS-ConfigureAWSPackage to install, and AmazonCloudWatch-ManageAgent to apply; instances need CloudWatchAgentServerPolicy.
- Container Insights: the cluster setting on ECS (Fargate needs nothing else; the ECS account setting only defaults new clusters), the CloudWatch Observability add-on on EKS; it does not ship application logs.
- Lambda Throttles are rejected requests that never ran; Lambda Insights adds memory and CPU; Bedrock token metrics feed alarms, while prompts and responses need model invocation logging (off by default).
- Only a high-resolution metric (StorageResolution 1) can back a 10- or 30-second alarm; detailed monitoring adds frequency, not new metrics.
- Metric filters count new log events only — alarm on their Sum, with a default value of 0; subscription filters stream events, cross-account through a Logs destination.
- Logs Insights queries history; Live Tail watches events as they arrive; log class is fixed at creation; long-term retention means exporting to S3.
- M-out-of-N need not be consecutive; treat missing data "ignore" freezes the current state; disabling actions does not stop evaluation.
- Metric alarms act directly via SNS, Lambda, EC2 actions, Auto Scaling, OpsItems (and, for existing Incident Manager users, incidents) and investigations; composites cannot take EC2 or Auto Scaling actions; runbooks go through EventBridge.
- Lambda alarm actions need the function policy to allow lambda.alarms.cloudwatch.amazonaws.com; encrypted SNS topics need a customer managed key that allows the publishing service.
- CloudTrail event history keeps 90 days of management events per Region and cannot be extended; longer retention needs a trail to S3.
- Cross-account observability links are Regional; dashboard email sharing covers one dashboard for up to five people, SSO sharing covers all dashboards.
Part 1: CloudWatch metrics
A metric is a namespace, name and dimension set; any mismatch means no data, and resolution decides how fast alarms can react.
Frequently asked questions
Why doesn't CloudWatch show memory utilization for my EC2 instance?
Because the default EC2 metrics come from the hypervisor, which cannot see inside the guest operating system. Memory utilization, disk-space utilization, and swap usage are OS-internal, so CloudWatch only receives them if you install and configure the CloudWatch agent on the instance. The agent reads a JSON configuration (best stored in Systems Manager Parameter Store for fleet-wide consistency) and needs the CloudWatchAgentServerPolicy on the instance role to publish.
What is the difference between standard and detailed monitoring in EC2?
Standard monitoring publishes EC2 instance metrics every 5 minutes at no charge. Detailed monitoring publishes the same metrics every 1 minute for an additional cost, letting alarms and Auto Scaling react faster. Detailed monitoring does not add any new metrics — it only increases frequency. It still will not give you memory or disk-space metrics; those need the CloudWatch agent.
What's the difference between a metric filter and a subscription filter in CloudWatch Logs?
A metric filter matches a pattern in a log group and publishes a CloudWatch metric — usually a value of 1 per match, alarmed on with the Sum statistic — so it produces a number. A subscription filter delivers the matching log events themselves, in near real time, to Kinesis Data Streams, Amazon Data Firehose, or a Lambda function, including to another account through a CloudWatch Logs destination. Use a metric filter to detect and alert; use a subscription filter to move or process the logs. Neither one processes events ingested before it was created.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.