Monitoring Pipeline Health with CloudWatch Metrics, Logs and Alarms
This lesson explains how Amazon CloudWatch monitors pipeline health: metrics show what is happening, logs show why, and alarms tell people when to act.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the metrics that matter for each pipeline service.
- Configure alarms and dashboards.
- Manage log retention and encryption.
Metrics that matter for pipelines
Each service in a pipeline publishes CloudWatch metrics that reveal its health. For Glue, job metrics and observability metrics show skew, memory pressure and throughput. For EMR, YARN available memory and pending applications show whether a cluster needs more capacity. For Kinesis, a rising IteratorAgeMilliseconds shows consumers falling behind, and throttling metrics show shards at their limits.
For Lambda, errors, duration, throttles and, for stream sources, iterator age matter most. For Redshift, CPU, the time queries wait in queues and disk usage show whether the warehouse is under strain. For Step Functions and MWAA, failed executions and scheduler health show whether pipelines run. Alarms on these metrics catch problems before users notice. The following table summarises the metrics.
| Service | Key metrics |
|---|---|
| Glue | Job metrics and observability metrics for skew, memory and throughput |
| EMR | YARN memory, pending applications |
| Kinesis | IteratorAgeMilliseconds, throttling |
| Lambda | Errors, duration, throttles, iterator age |
| Redshift | CPU, query queue time, disk usage |
| Step Functions, MWAA | Failed executions; scheduler health |
Key pipeline metrics
Alarms and dashboards
Metrics and logs are useful only if someone notices when they show a problem. A CloudWatch alarm evaluates a metric against a threshold over a number of periods, for example Glue job failures greater than zero in five minutes, and when the condition is met, it notifies people through Amazon SNS or triggers an action, such as an Auto Scaling policy or a Systems Manager runbook.
Fixed thresholds do not suit every metric, because normal values vary by time of day and day of week. Anomaly detection alarms learn a metric's normal pattern and alert when it moves outside the expected band, which suits measures such as records ingested per hour. Composite alarms combine several alarms with logical conditions, so one incident produces one notification instead of many. Dashboards bring metrics and alarm states from many services onto one screen, giving an operational view of a whole pipeline.
The following diagram shows a morning's timeline for a daily sales table and the monitoring signal behind each alert.

Alarm types
Logs
Log groups each have a retention setting (by default never expiring) and optional KMS encryption. Lambda supports structured JSON logs and log levels; Glue offers continuous logging of driver and executor logs.
Three features make logs useful beyond reading them line by line. A metric filter matches a pattern in log events, such as lines containing ERROR, and turns the matches into a metric that an alarm can watch. A subscription filter streams matching log events in real time to Lambda, to Firehose for delivery to S3, or to OpenSearch for search and analysis. CloudWatch Logs Insights runs interactive queries across log groups, with commands such as filter, stats and parse, for example counting errors per job per hour. The following table summarises the features.
| Feature | Turns logs into |
|---|---|
| Metric filters | Metrics you can alarm on, such as a count of ERROR lines |
| Subscription filters | Real-time streams to Lambda, Firehose (then S3) or OpenSearch |
| CloudWatch Logs Insights | Interactive queries with fields, filter, stats and parse |
The following diagram shows the three ways a log group feeds monitoring and analysis.

A Logs Insights query
Knowing a pipeline is late before anyone asks
Business users complain when the daily sales table is not ready by 07:00. The team wants to know first.
| Signal | Implementation |
|---|---|
| Job failed | EventBridge rule on Glue Job State Change FAILED → SNS |
| Job slow | Alarm on Glue job elapsed time above its usual range |
| Data not fresh | The final step publishes a custom metric LastSuccessfulLoad; an alarm fires if it has not been updated by 06:30 |
| Stream falling behind | Alarm on Kinesis GetRecords.IteratorAgeMilliseconds |
The freshness metric catches the case the others miss: a job that never started at all. Alarms based on the absence of a success signal are essential for scheduled pipelines.
How can logs be streamed to S3 or OpenSearch?
Show answer
With a subscription filter that sends them through Firehose.
Exam Tips
Remember for the exam
- To alert on ERROR lines in logs, create a metric filter and an alarm.
- To query logs interactively, use CloudWatch Logs Insights.
- To stream logs to S3 or OpenSearch, use a subscription filter, through Firehose.
- To detect consumers falling behind a stream, alarm on the iterator age.
- Logs are kept for ever by default, so set a retention period.