Pair your devices with a code and playback position follows you: pause on this device, hit resume on the other. Position is saved to the site every minute and on pause.
Open this panel on your other device and enter the same code.
Starts this lesson and continues through 8 more to the end of the course.
A Glue job that errors out at 02:00 is a nuisance. A Glue job that succeeds with zero records read because the upstream partition never landed — unnoticed until Monday's Redshift report is empty — is a career event. The difference is entirely in what you alarm on.
What the posting is really asking. "Implement monitoring and alerting using CloudWatch for data pipeline health and performance" means: can you name the metrics Glue, Lambda, Redshift, Athena and Kafka actually publish, set an alarm with the right missing-data behaviour, catch job state changes with EventBridge, and extract structured metrics from logs — without paging a human for noise.
From CloudWatch concepts (verified 2026-10-30):
| Concept | Rule that matters |
|---|---|
| Namespace | Container for metrics. There is no default namespace — every custom data point needs one. AWS namespaces follow AWS/<service> (e.g. AWS/Lambda, AWS/Athena). |
| Dimension | Name/value pair that is part of the metric identity. Up to 30 dimensions per metric. Each unique combination is a separate metric; CloudWatch does not aggregate across dimensions you didn't publish. |
| Period | Length of one statistic, in seconds. Valid values: 1, 5, 10, 30 or any multiple of 60. Default 60. |
| Statistics | Aggregations over a period (Sum, Average, Min, Max, SampleCount, percentiles). Points with different units aggregate separately. |
| Resolution | Standard = one-minute granularity (all AWS-service metrics). High-resolution = one second; only custom metrics, readable at 1/5/10/30 s periods. High-resolution alarms use 10 s or 30 s periods and cost more. |
| Data point period | Kept for |
|---|---|
| < 60 s (high-res custom) | 3 hours |
| 60 s | 15 days |
| 300 s | 63 days |
| 3600 s | 455 days (15 months) |
Finer data is rolled up, not deleted: after 15 days 1-minute points are only retrievable at 5-minute resolution; after 63 days, hourly. Metrics with no new data expire after 15 months.
⚠️ A per-minute trend of last quarter's elapsedTime does not exist. Export with
get-metric-data on a schedule, or accept hourly roll-ups.
Alarm states (Alarm evaluation, verified 2026-10-30):
OK — metric or expression is within threshold.ALARM — outside the threshold.INSUFFICIENT_DATA — alarm just started, metric not available, or not enough data to decide.Evaluation Periods (N) and Datapoints to Alarm (M) give you "M out of N". The breaching points do not have to be consecutive — they just have to fall within the last N. The evaluation interval (period × evaluation periods) is capped at one day for periods under an hour and seven days for periods of an hour or more.
From Configuring how alarms treat missing data (verified 2026-10-30):
TreatMissingData |
Behaviour | Use for |
|---|---|---|
notBreaching |
Missing = good | Error-only metrics (Errors, numFailedTasks) that emit nothing when healthy |
breaching |
Missing = bad | "Heartbeat" metrics — a job that should report every run |
ignore |
Keep current state | Metrics with gaps you don't care about |
missing (default) |
All points missing → INSUFFICIENT_DATA |
Rarely what you want for pipelines |
⚠️ The default is missing. Glue only emits glue.driver.aggregate.* while a job is running. An
alarm with the default setting on a job that never started will sit in INSUFFICIENT_DATA forever
and never page. For "did my nightly load run at all?", use breaching.
A metric alarm can notify an SNS topic, perform EC2 or Auto Scaling actions, start a CloudWatch investigation, or create a Systems Manager OpsItem/incident (Using alarms). Actions fire only on state change (except Auto Scaling). Alarm history is kept 30 days. No limit on alarm count. CloudWatch does not validate that your SNS topic exists — a typo in the ARN is a silent non-page.
From the put-metric-alarm reference (verified 2026-10-30):
aws cloudwatch put-metric-alarm --alarm-name cpu-mon --alarm-description "Alarm when CPU exceeds 70 percent" --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 300 --threshold 70 --comparison-operator GreaterThanThreshold --dimensions "Name=InstanceId,Value=i-12345678" --evaluation-periods 2 --alarm-actions arn:aws:sns:us-east-1:111122223333:MyTopic --unit Percent
The same shape for a pipeline: swap --namespace Glue --metric-name glue.driver.aggregate.numFailedTasks --statistic Sum --dimensions Name=JobName,Value=<job> Name=JobRunId,Value=ALL Name=Type,Value=count and add --treat-missing-data notBreaching --datapoints-to-alarm 1. Both --treat-missing-data (breaching | notBreaching | ignore | missing) and --datapoints-to-alarm are documented parameters. Re-running the command with an existing name overwrites the alarm.
Test the wiring without waiting for a failure:
aws cloudwatch set-alarm-state --alarm-name cpu-mon --state-reason "initializing" --state-value ALARM
A composite alarm's rule expression references other alarms' states — ALARM("x"),
OK("y"), INSUFFICIENT_DATA("z") joined by AND, OR, NOT and parentheses
(Create a composite alarm):
(ALARM("CPUUtilizationTooHigh") OR
ALARM("DiskReadOpsTooHigh")) AND
OK("NetworkOutTooHigh")
Composites can send SNS but cannot perform EC2 or Auto Scaling actions, and cross-account composites are not supported. Page once for "the pipeline is unhealthy", not five times.
put-retention-policy --retention-in-days): 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653. Expired events can take up to 72 hours to actually delete.Commands include fields, filter, stats, sort, limit, parse, dedup, pattern,
diff, unnest. Two from the examples page:
filter @message like /Exception/
| stats count(*) as exceptionCount by bin(1h)
| sort exceptionCount desc
fields @timestamp, @requestId, @message, @logStream
| filter @type = "REPORT" and @duration > 1000
| sort @timestamp desc
| dedup @requestId
| limit 20
| Metric filter | Subscription filter | |
|---|---|---|
| Does | Turns matching log lines into a metric you can alarm on | Streams matching events to Kinesis Data Streams, Lambda, Data Firehose, or OpenSearch |
| Quota per log group | 100 (not adjustable) | 5 (not adjustable) |
| Gotchas | Not retroactive. Set a default value of 0 so the metric isn't "spotty" — but you can't set one if the metric has dimensions. At-least-once delivery, so duplicates can occur. Standard log class only. | — |
⚠️ A metric filter with dimensions and no default value produces missing data between matches —
which brings you straight back to the TreatMissingData table above.
Write a JSON log line with an _aws block and CloudWatch extracts metrics — no PutMetricData. From the
specification
(verified 2026-10-30):
{
"_aws": {
"Timestamp": 1574109732004,
"CloudWatchMetrics": [
{
"Namespace": "lambda-function-metrics",
"Dimensions": [["functionVersion"]],
"Metrics": [
{
"Name": "time",
"Unit": "Milliseconds",
"StorageResolution": 60
}
]
}
]
},
"functionVersion": "$LATEST",
"time": 100,
"requestId": "989ffbf8-9ace-4817-a57c-e4dd734019ee"
}
Rules: Timestamp is epoch milliseconds, no more than 14 days past or 2 hours future; at most
100 MetricDefinitions per log event and 30 dimension keys per DimensionSet; every
DimensionSet creates a new metric. When sending by PutLogEvents yourself, add the header
x-amzn-logs-format: json/emf. Cleanest way to emit rows_written from a PySpark driver or a Lambda.
Glue emits "detail-type":"Glue Job State Change" for SUCCEEDED, FAILED, TIMEOUT, STOPPED, and
"Glue Job Run Status" for RUNNING/STARTING/STOPPING runs that exceed the job delay
notification threshold (which you must set) — one event per run
(Automating Glue with EventBridge).
Delivery is best effort. Pattern from the
EventBridge Glue reference:
{
"source": ["aws.glue"],
"detail-type": ["Glue Job State Change"]
}
⚠️ I could not verify a published sample payload for Glue Job State Change showing the exact
detail field names — check events-ref-glue.html or capture a real event to a CloudWatch Logs
target before filtering on detail.state.
EMR's sample payload is published (When to set up EMR events):
{
"version": "0",
"id": "999cccaa-eaaa-0000-1111-123456789012",
"detail-type": "EMR Step Status Change",
"source": "aws.emr",
"account": "123456789012",
"time": "2016-12-16T20:53:09Z",
"region": "us-east-1",
"resources": [],
"detail": {
"severity": "ERROR",
"actionOnFailure": "CONTINUE",
"stepId": "s-ZYXWVUTSRQPON",
"name": "CustomJAR",
"clusterId": "j-123456789ABCD",
"state": "FAILED",
"message": "Step s-ZYXWVUTSRQPON (CustomJAR) in Amazon EMR cluster j-123456789ABCD (Development Cluster) failed at 2016-12-16 20:53 UTC."
}
}
EMR Cluster State Change has the same envelope with detail.state (e.g. WAITING) and
stateChangeReason. Prefer events over polling DescribeStep.
| Service | Namespace | Watch these | Notes (verified 2026-10-30) |
|---|---|---|---|
| Glue | Glue |
glue.driver.aggregate.numFailedTasks, .elapsedTime, .recordsRead, .bytesRead, .numCompletedTasks, .shuffleBytesWritten; glue.ALL.jvm.heap.usage |
Sent every 30 s. Dimensions JobName, JobRunId (or ALL), Type. Aggregate metrics are deltas — use SUM. |
| Lambda | AWS/Lambda |
Errors, Throttles, Duration, IteratorAge, OffsetLag |
Throttles are not counted in Invocations or Errors. IteratorAge = age of the last record for Kinesis/DynamoDB/DocumentDB sources; OffsetLag for MSK/self-managed Kafka. Duration excludes cold start. |
| Redshift | AWS/Redshift |
QueryDuration, WLMQueueLength, WLMQueueWaitTime, HealthStatus, PercentageDiskSpaceUsed, CommitQueueLength |
QueryDuration is in microseconds, 5-minute intervals, not on single-node clusters. HealthStatus runs a probe query every minute. |
| Kinesis | AWS/Kinesis |
GetRecords.IteratorAgeMilliseconds, WriteProvisionedThroughputExceeded, ReadProvisionedThroughputExceeded, PutRecords.ThrottledRecords |
Iterator age of 0 = consumer fully caught up; alarm on Maximum. |
| MSK | AWS/Kafka |
MaxOffsetLag, EstimatedMaxTimeLag, OfflinePartitionsCount, UnderReplicatedPartitions, KafkaDataLogsDiskUsed |
Consumer-lag metrics are per consumer group + topic. |
| Athena | AWS/Athena |
TotalExecutionTime, QueryQueueTime, ProcessedBytes, EngineExecutionTime, DPUConsumed |
Per workgroup; ProcessedBytes is your cost proxy. aws cloudwatch list-metrics --namespace "AWS/Athena" |
Batch pipeline (Glue / EMR / Lambda → Redshift / Athena)
| Signal | Source | Missing data | Why |
|---|---|---|---|
| Job FAILED / TIMEOUT / STOPPED | EventBridge Glue Job State Change → SNS |
n/a | Faster and more precise than any metric alarm |
| No successful run by deadline | Custom EMF run_succeeded or recordsRead Sum, breaching |
breaching | Catches the job that never started |
recordsRead Sum below floor |
Glue |
breaching | The "succeeded with zero rows" case |
elapsedTime > p95 × 1.5 |
Glue |
notBreaching | Stragglers before they hit the timeout |
WLMQueueLength / WLMQueueWaitTime |
AWS/Redshift |
notBreaching | Loads queueing behind BI traffic |
PercentageDiskSpaceUsed > 80 |
AWS/Redshift |
notBreaching | COPY fails hard at full disk |
Errors > 0 (M of N = 1 of 1) |
AWS/Lambda |
notBreaching | Error-only metric |
Streaming pipeline (Kafka / Kinesis → Lambda / Glue streaming)
| Signal | Source | Missing data | Why |
|---|---|---|---|
IteratorAge or MaxOffsetLag rising |
AWS/Lambda / AWS/Kafka |
breaching | Consumer stopped: lag grows, metric vanishes |
Throttles > 0 |
AWS/Lambda |
notBreaching | Throttled invocations aren't Errors |
OfflinePartitionsCount > 0, UnderReplicatedPartitions > 0 |
AWS/Kafka |
breaching | Broker/cluster health |
WriteProvisionedThroughputExceeded > 0 |
AWS/Kinesis |
notBreaching | Producers being rejected |
glue.driver.streaming.batchProcessingTimeInMs > trigger interval |
Glue |
breaching | Micro-batches falling behind |
| Composite: lag AND (throttles OR errors) | composite alarm | — | One page, not three |
From CloudWatch service quotas (verified 2026-10-30):
| Quota | Default | Adjustable |
|---|---|---|
PutMetricData requests/s |
500 | Yes |
GetMetricData requests/s |
500 | Yes |
DescribeAlarms requests/s |
9 | Yes |
DeleteAlarms requests/s |
3 | No |
| Metrics Insights alarms | 200 | No |
| Alarm mute rules | 2,000 | No |
| Metric filters per log group | 100 | No |
| Subscription filters per log group | 5 | No |
| Log event size | 1,024 KB | No |
⚠️ PutMetricData at 500/s per Region is per account, shared by every Glue executor and Lambda
you own. EMF through logs sidesteps it entirely.
From the pricing page (verified 2026-10-30): the
free tier includes 10 custom/detailed metrics, 10 alarm metrics (standard resolution, direct
metrics), 1 million API requests (excluding GetMetricData, GetInsightRuleReport,
GetMetricWidgetImage, which are always charged), and 5 GB of Logs (ingestion, storage and
Insights scan combined). Custom metrics are tiered per metric-month (first 10,000 / next 240,000 / next 750,000 /
over 1,000,000); PutMetricData adds $0.01 per million requests. Alarms are per alarm metric per
month (high-resolution and composite priced separately). Logs: per GB ingested, per GB-month
stored, per GB scanned.
⚠️ I could not verify the dollar figures for the metric tiers, alarms, or Logs ingestion — the
pricing page renders them client-side. Check aws.amazon.com/cloudwatch/pricing/ in a browser
or use the AWS Pricing Calculator.
INSUFFICIENT_DATA for three weeks and the job has failed twice. Why?Exception lines per hour as an alarmable metric from a log group that already has 100 metric filters. Options?QueryDuration on a dev single-node Redshift cluster always empty?recordsRead data points?TreatMissingData defaults to missing. numFailedTasks is only emitted while the job runs, so between runs the alarm reverts to INSUFFICIENT_DATA; a brief failure spike may never satisfy the evaluation window. Use notBreaching with --datapoints-to-alarm 1, or alarm on the Glue Job State Change event instead.IteratorAge (milliseconds). Alarm on Maximum; a value of 0 means fully caught up. For MSK sources, OffsetLag.ALARM("a") OR ALARM("b") ... and an SNS action. It cannot perform EC2 or Auto Scaling actions and cannot be cross-account.stats count(*) by bin(1h) query (a log alarm), or emit the count as EMF from the application, or route via a subscription filter to Lambda that publishes a metric.QueryDuration is not supported on single-node clusters.put-metric-alarm, then set-alarm-state to ALARM and show the SNS email. Delete the topic, repeat — nothing arrives, no error.Errors with breaching for missing data — paged every quiet hour.