CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
  • Week 1
    • 1.What Is Data Engineering
    • 2.Batch vs Streaming
    • 3.A Bird's-Eye View of AWS Data Services
    • 4.Data Formats and Modeling
    • 5.Week 1 Comprehensive Review
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
    • 1.Pipeline Monitoring: CloudWatch Metrics, Logs, and Alarms
    • 2.Data Quality and Validation: Glue Data Quality and Quality Gates
    • 3.Logging, Audit, and Troubleshooting: CloudTrail and Failure Recovery
    • 4.Cost and Performance Operations: Monitoring, Sizing, Auto Scaling
    • 5.Week 8 Comprehensive Review: Data Operations and Support Recap
  • Week 9
  • Week 10
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← DEA-C01/Week 8/Day 1

Based on the DEA-C01 exam guide·Report an error

DEA-C01· AssociateWeek 8 · Day 1~32 min read

Day 1 - Pipeline Monitoring: CloudWatch Metrics, Logs, and Alarms

📌 Key Takeaways

  • Observability = metrics (CloudWatch Metrics) + logs (CloudWatch Logs) + traces (X-Ray). CloudWatch is the starting point for data pipeline monitoring.
  • An alarm fires when Datapoints to Alarm datapoints breach the threshold within Period × Evaluation Periods. A metric that stops arriving altogether is only caught if you decide it explicitly with TreatMissingData.
  • Glue sends metrics every 30 seconds and EMR every 5 minutes. For Glue you watch task failures, shuffle, and executor counts; for EMR you watch YARN memory, pending containers, and IsIdle.
  • The key streaming-lag metric is GetRecords.IteratorAgeMilliseconds (statistic: Maximum), and throttling shows up in Read/WriteProvisionedThroughputExceeded.
  • For custom metrics, EMF, which emits metrics from a single log line, fits Lambda and container pipelines better than PutMetricData, and alarm storms are tamed by grouping alarms into a composite alarm.

Three Pillars of Observability and CloudWatch

With data pipelines, "confirming that they keep running" is harder than "making them run in the first place." Today we look at how to observe Glue, EMR, and Kinesis with CloudWatch at the center, and how to trace delays.

  • Operational visibility is usually described through three pillars: metrics, logs, and traces. In AWS these are CloudWatch Metrics, CloudWatch Logs, and AWS X-Ray respectively.
  • Most AWS services publish operational metrics to their own namespaces with no extra configuration, so pipeline monitoring almost always starts in CloudWatch.
ComponentWhat it holdsUse in a pipeline
CloudWatch MetricsTime-series numbers (organized by namespace and dimensions)Failed job count, records processed, lag
CloudWatch LogsText log streamsJob stdout, driver and executor logs, Lambda output
CloudWatch AlarmsResult of comparing a metric to a thresholdSNS notifications, automated actions
AWS X-RayTime spent in each segment of a single requestTracing bottlenecks in segments that include Lambda or APIs

Metric Structure: Namespaces, Dimensions, Resolution, Retention

  • A metric is identified by the combination of name + namespace + dimensions. If the dimension combination differs, it is a different metric even with the same name. You can attach up to 30 dimensions to a metric.
  • For AWS service metrics, omitting a dimension in a query sometimes returns an aggregate, but custom metrics are not aggregated across dimensions. They can only be queried by exactly the dimension combination they were published with. This is the cause of "I specified just one dimension and no data shows up."
  • There are two resolutions. Standard resolution is 1-minute granularity and high resolution is 1-second granularity; only custom metrics can be published at high resolution.
  • Metrics cannot be deleted, and they expire after 15 months if no new data arrives. The older the data, the more coarsely it is rolled up.
Datapoint periodRetention
Under 60 seconds (high resolution)3 hours
1 minute15 days
5 minutes63 days
1 hour455 days (15 months)
  • Setting an alarm period shorter than the metric resolution is pointless. If you put a 1-minute alarm on a metric that arrives every 5 minutes, most periods end up as "no data."
  • High-resolution metrics can have high-resolution alarms with 10-second or 30-second periods, and these alarms cost more than regular alarms.

💡 Related theory: To catch fast-changing streaming lag at second-level granularity, use a high-resolution custom metric; for ordinary batch jobs, use standard resolution. High-resolution data stays at one-second granularity for only 3 hours, so for looking at "last night's trend" it ends up being 1-minute aggregation anyway.

Custom Metrics: PutMetricData, EMF, Metric Filters

When the default service metrics are not enough, the application creates its own metrics. There are three ways.

MethodHow it worksFits whenWeakness
PutMetricData APICode calls CloudWatch directlyBatch jobs with a low call frequencyBilled per call; a synchronous call adds latency
EMF (Embedded Metric Format)You print a JSON log in a defined structure and CloudWatch extracts the metricsEnvironments like Lambda and containers where logs already flowRequires a log ingestion path
Metric filterCounts lines matching a pattern in existing logs and turns them into a metricERROR counts for jobs whose code you cannot changePattern matching only; does not apply retroactively to logs from before the filter was created
{
  "_aws": {
    "Timestamp": 1750000000000,
    "CloudWatchMetrics": [{
      "Namespace": "DataPipeline",
      "Dimensions": [["PipelineName"]],
      "Metrics": [{ "Name": "RecordsProcessed", "Unit": "Count" }]
    }]
  },
  "PipelineName": "orders-etl",
  "RecordsProcessed": 18420
}
  • EMF leaves both the metric and its context (which pipeline, which batch) in a single log line. When a metric spikes, you can find the cause right in the same log.
  • If you put a field whose values grow without bound, such as a request ID, into a dimension, every dimension combination creates its own metric and costs balloon. Limit dimensions to low-cardinality values such as pipeline name or environment.

How Alarms Are Evaluated

SettingMeaning
PeriodThe aggregation interval that produces one datapoint
Evaluation Periods (N)How many of the most recent periods to look at
Datapoints to Alarm (M)How many of those must breach the threshold for ALARM ("M out of N")
TreatMissingDataHow to treat periods that have no datapoint
  • An alarm has three states: OK, ALARM, and INSUFFICIENT_DATA. Actions run once when the state changes (Auto Scaling actions are the only exception).
  • There are four values for missing-data handling, and the default is missing.
ValueHow missing periods are treatedSuitable metrics
missing (default)If the whole evaluation range is empty, the alarm goes to INSUFFICIENT_DATAThe general case
notBreachingTreated as healthyMetrics that appear only when an error occurs (throttle counts, etc.)
breachingTreated as a breachMetrics that must always arrive (heartbeats, processed counts)
ignoreKeeps the current stateMetrics that are reported only intermittently
  • If a job does not run at all, the failure metric is not emitted either. With the default, the alarm just moves to INSUFFICIENT_DATA with no notification. This is the classic incident of "the pipeline stopped overnight and the alarm was silent." Set breaching on a metric such as processed count, or attach an action to the INSUFFICIENT_DATA transition as well.
  • A composite alarm combines the states of other alarms with AND/OR. Attaching notifications only to the composite alarm and not to the underlying alarms reduces alarm storms. A composite alarm can send SNS notifications but cannot run EC2 or Auto Scaling actions.
  • Put alarms on symptoms (rising lag, rising failure rate), and look at plain resource numbers on a dashboard.
# Notify if consumer lag stays above 1 minute for 5 minutes
aws cloudwatch put-metric-alarm \
  --alarm-name orders-stream-consumer-lag \
  --namespace AWS/Kinesis \
  --metric-name GetRecords.IteratorAgeMilliseconds \
  --dimensions Name=StreamName,Value=orders \
  --statistic Maximum --period 60 \
  --evaluation-periods 5 --datapoints-to-alarm 5 \
  --threshold 60000 --comparison-operator GreaterThanThreshold \
  --treat-missing-data breaching \
  --alarm-actions arn:aws:sns:ap-northeast-2:111122223333:data-oncall
  • This metric exists only when a consumer calls GetRecords. If the consumer dies, the metric stops, so you must set breaching so that "consumer stopped" is caught by the same alarm.

Glue Monitoring

When job metrics are enabled (--enable-metrics), a Glue job sends metrics to the Glue namespace every 30 seconds. The dimensions are JobName, JobRunId, and Type (count or gauge). They are recorded as custom metrics, so CloudWatch charges may apply.

MetricWhat it tells you
glue.driver.aggregate.numCompletedTasks / numFailedTasksProgress, and task failures caused by data or script problems
glue.driver.aggregate.numKilledTasksTasks killed by OOM and the like (suspect skew)
glue.driver.aggregate.elapsedTimeETL elapsed time (excluding bootstrap). Detects runs slower than usual
glue.driver.aggregate.bytesRead / recordsReadVolume read. Whether the bookmark skipped data or the same data is being read again
glue.driver.aggregate.shuffleBytesWrittenShuffle volume. The cost of large joins, groupBy, and repartition
glue.driver.jvm.heap.usage / glue.ALL.jvm.heap.usageDriver and executor heap usage (0 to 1). A precursor to OOM
glue.driver.ExecutorAllocationManager.executors.numberAllExecutorsNumber of executors currently running
glue.driver.ExecutorAllocationManager.executors.numberMaxNeededExecutorsMaximum number of executors needed for the current load
  • Look at the last two metrics overlaid. If the "needed" count is consistently larger than the "running" count, DPUs are insufficient; if it is far smaller, you have provisioned too much.
  • If only the driver heap spikes, suspect code that pulls data into the driver (collect) or listing hundreds of thousands of small files. If only a particular executor spikes, it is skew.
  • Logs: From Glue 5.0 onward, every job writes logs in real time. On 4.0 and earlier, you must turn on Continuous Logging (--enable-continuous-cloudwatch-log) for logs to flow to CloudWatch Logs before the job ends; with it off, you can see them only after the job finishes. Exam material usually asks this as "turn on continuous logging."
  • The default log groups are /aws-glue/jobs/output (user stdout and stderr) and /aws-glue/jobs/error (system and Spark logs).
# Write to the driver log stream in real time from inside the job script
logger = glueContext.get_logger()
logger.info("orders partition dt=2026-06-26 loaded")
logger.error("schema mismatch: email column missing")

💡 Related theory: A Glue Job Bookmark is not a monitoring metric; it is state that makes a job skip data it has already processed, preventing duplicate processing on rerun. However, if the bytesRead metric suddenly drops close to 0 or jumps to several times its usual level, that is a clue that the bookmark has gone wrong.

EMR Monitoring

EMR sends cluster metrics to the AWS/ElasticMapReduce namespace every 5 minutes. The interval cannot be changed, and the metrics themselves carry no charge.

MetricMeaningUsed for
YARNMemoryAvailablePercentagePercentage of memory remaining in YARNScaling decisions, failure precursor
ContainerPendingRatioPending containers ÷ allocated containers (a number, not a percentage)Signal of resource shortage
AppsPending / AppsRunning / AppsFailedYARN application statesProgress and health
HDFSUtilizationHDFS utilizationDeciding whether to add core nodes
MRUnhealthyNodes / MRLostNodesNumber of nodes with full disks or lost communicationNode failures
IsIdle1 if there are no tasks or jobsDetecting idle clusters
  • IsIdle looks only at that instant, every 5 minutes. A value of 1 does not mean the cluster idled for the entire 5 minutes, so set the alarm for when it is 1 several times in a row, such as for 30 minutes.
  • The feature that shuts down an idle cluster by itself is the auto-termination policy. After the specified idle time passes, EMR terminates the cluster.
  • When a cluster disappears, the nodes' logs disappear with it. You must configure step logs and Spark event logs to be kept in S3 so you can debug after termination.

Kinesis Monitoring and Tracking Lag

In streaming, "how far behind are we right now" is the heart of the matter.

MetricMeaningDirection of action
GetRecords.IteratorAgeMillisecondsHow long ago the last-read record entered the stream. 0 means fully caught upIncrease consumer throughput, check for stalls from error retries
IncomingBytes / IncomingRecordsInbound volumeBasis for recalculating the shard count
WriteProvisionedThroughputExceededNumber of write records rejected by throttlingAdd shards, check partition key distribution
ReadProvisionedThroughputExceededNumber of throttled GetRecords callsReduce the number of consumers, use enhanced fan-out
PutRecords.ThrottledRecords / FailedRecordsRecords rejected within a batchCheck that the producer retries partial failures
SubscribeToShardEvent.MillisBehindLatestHow far an enhanced fan-out consumer is from the tip of the streamPer-consumer lag
  • Stream-level metrics arrive every minute at no charge. Shard-level metrics (enhanced monitoring) must be turned on separately with EnableEnhancedMonitoring and are billed per shard and per metric. To see "whether only a specific shard is hot," you need to turn this on.
  • Put the iterator age alarm on the Maximum statistic. Average hides a lagging shard behind shards that are keeping up.
  • If this value exceeds half the retention period, records are at risk of expiring and being lost. This alarm takes priority over the throttle alarm.

Finding Answers in Logs

  • If you do not set a retention period on a log group, logs accumulate without expiring. Set a retention period for each job to control storage cost.
  • Logs Insights queries log groups with a query language. You are billed for the amount of log data scanned, so narrow the time range when you run it.
  • A subscription filter forwards logs in real time to Lambda, Kinesis, or Firehose. Use it to archive logs in S3 for the long term or to send them to OpenSearch.
# Logs Insights: error count per 5-minute bin in recent runs
fields @timestamp, @message
| filter @message like /Exception|ERROR/
| stats count(*) as errors by bin(5m)
| sort errors desc

Symptom → Cause → Action

SymptomLikely causeAction
The pipeline stopped but no alarm firedThe metric stopped, so the alarm only went to INSUFFICIENT_DATATreatMissingData=breaching, or a lower-bound alarm on processed count
Dozens of alarms fire at onceOne cause spreads across many metricsGroup them with a composite alarm and send notifications only from the parent alarm
A Glue job takes several times longer than usual, with only some executors busyData skewCheck shuffle metrics and per-executor heap; distribute keys
An EMR step just waitsInsufficient YARN memoryCheck ContainerPendingRatio and YARNMemoryAvailablePercentage, then scale out
Iterator age keeps increasingConsumer processing is too slow, or stalled by error retriesCheck consumer logs and error rate; increase shards and parallelism
Custom metric charges spikeA field with many unique values is used as a dimensionReduce dimensions to low-cardinality values

Question Clue → Answer Lookup Table

Question clueAnswer
"The metric that most directly shows whether a consumer is falling behind"GetRecords.IteratorAgeMilliseconds
"Logs in real time before the job ends"Glue continuous logging
"Both the metric and its context in a single log line"EMF
"Turn the error count in existing logs into a metric without changing the code"CloudWatch Logs metric filter
"Combine several alarms with AND/OR to suppress notification storms"Composite alarm
"Detect idle EMR clusters"IsIdle (or the auto-termination policy)
"Check whether only a specific shard is throttled"Shard-level enhanced monitoring
"Who changed the configuration"Not CloudWatch but CloudTrail (Day 3)

Tomorrow we cover the problem that a pipeline can run perfectly and still produce wrong content, that is, Glue Data Quality and validation gates.

📖 Glossary

  • Namespace: The container that holds metrics. AWS services use their own namespaces such as AWS/Kinesis.
  • Dimension: A name-value pair attached to a metric. Even with the same metric name, different dimensions make separate metrics.
  • EMF: A format where printing a JSON log in a defined structure lets CloudWatch extract metrics automatically.
  • Metric filter: A setting that counts lines matching a pattern in logs and turns them into a metric.
  • Datapoints to Alarm: The value that sets how many of the evaluation periods must breach the threshold for the alarm to fire.
  • TreatMissingData: An alarm setting that decides whether periods with no data are treated as healthy, breaching, or ignored.
  • Composite alarm: An alarm that combines the states of other alarms with AND/OR and evaluates them as one.
  • Continuous logging: A feature that sends logs to CloudWatch Logs in real time even before a Glue job ends.
  • Iterator age: How long ago the record a consumer just read entered the stream. The larger it is, the further behind the consumer is.
  • Enhanced monitoring: A paid option that delivers Kinesis metrics per shard.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which CloudWatch metric most directly indicates whether a Kinesis Data Streams consumer is failing to keep up with the incoming rate and processing delay is accumulating?

Question 2

Which feature must be enabled to view the logs of a long-running Glue ETL job in CloudWatch Logs in real time, even before the job finishes?

Question 3

Which approach lets a Lambda or container-based pipeline write metrics and rich context together in a single log line and have CloudWatch extract the metrics automatically?

Question 4

Which CloudWatch feature combines alarms with AND/OR logic and evaluates them as a single higher-level state, to reduce alarm storms where many individual alarms fire at the same time?

Question 5

Which CloudWatch metric is the most appropriate for determining whether an EMR cluster has finished its work and has nothing more to process and is only incurring cost, to help decide on automatic termination?

PreviousWeek 7 Comprehensive Review: Analytics Stores RecapWeek 7 · Day 5Next Data Quality and Validation: Glue Data Quality and Quality GatesWeek 8 · Day 2

Official references

  • DEA-C01 official exam page(opens in a new tab)
  • Amazon CloudWatch documentation(opens in a new tab)
  • AWS Glue documentation(opens in a new tab)
  • Amazon EMR documentation(opens in a new tab)
  • Amazon Kinesis documentation(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)

On this page

  • Key Takeaways
  • Three Pillars of Observability and CloudWatch
  • Metric Structure: Namespaces, Dimensions, Resolution, Retention
  • Custom Metrics: PutMetricData, EMF, Metric Filters
  • How Alarms Are Evaluated
  • Glue Monitoring
  • EMR Monitoring
  • Kinesis Monitoring and Tracking Lag
  • Finding Answers in Logs
  • Symptom → Cause → Action
  • Question Clue → Answer Lookup Table
  • Glossary
  • Practice Questions