Amazon EMR (Elastic MapReduce) is AWS’s managed big data service for running distributed frameworks such as Apache Spark, Apache Hadoop, Hive, and Presto on EC2 clusters. When a cluster is processing production workloads, silent failures and resource exhaustion are expensive. A job that runs three times longer than expected, a node that quietly drops off the cluster, or an HDFS volume that fills up unnoticed can cascade into SLA breaches and runaway costs.
Effective AWS EMR monitoring means watching two distinct planes at the same time: the cluster infrastructure layer (are all nodes healthy, is HDFS full, are containers queued?) and the application layer (which Spark stage is slow, why did a task fail, how long did each micro-batch take?). This guide covers every tool and technique you need to cover both planes, from the AWS native stack to open-source alternatives.
Key Takeaways
- EMR auto-pushes metrics to CloudWatch every 5 minutes, free with no configuration needed.
- The EMR console Monitoring tab gives instant cluster, node, and I/O visibility out of the box.
- Watch four critical metrics: MRUnhealthyNodes, MRLostNodes, IsIdle, and HDFSUtilization.
- Spark History Server and YARN Timeline Server stay accessible for 30 days post-termination.
- Publish custom Spark metrics to CloudWatch via a configurable sink for stage- and task-level dashboards.
- Prometheus + Grafana or Datadog provide deeper, multi-cluster observability beyond what CloudWatch offers.
1. Understanding the EMR Cluster Lifecycle
Before you can monitor effectively, it helps to understand what you are monitoring. An EMR cluster moves through several states during its lifetime:
- STARTING – EC2 instances are being provisioned.
- BOOTSTRAPPING – Bootstrap actions and application installations are running.
- RUNNING – The cluster is active and processing steps.
- WAITING – All steps have completed but the cluster is still running (and accruing charges).
- TERMINATING – The cluster is shutting down.
- TERMINATED or TERMINATED_WITH_ERRORS – Final state.
Amazon EMR records an event in its event stream every time a cluster, step, instance group, instance fleet, or auto-scaling policy changes state. These events are also forwarded to Amazon CloudWatch Events (EventBridge), so you can automate responses such as invoking a Lambda function or sending an SNS notification whenever a cluster fails or a step completes.
2. Native AWS EMR Monitoring: The EMR Console
The simplest starting point for aws emr monitoring is the Monitoring tab inside the EMR cluster details page in the AWS Management Console. No configuration is required. The tab surfaces three pre-built report categories:
- Cluster status – Visualizes running and remaining map and reduce tasks, failed tasks, and overall job progress.
- Node status – Shows running, pending, and decommissioned core and task nodes.
- Inputs and outputs – Displays bytes read from and written to S3 and HDFS.
To reach the Monitoring tab, navigate to the Amazon EMR console, choose Clusters under EMR on EC2, select your cluster, and then select the Monitoring tab. Each graph is interactive and supports custom time ranges.
3. Amazon CloudWatch Metrics for AWS EMR Monitoring
How EMR Metrics Work
Amazon EMR automatically pushes metrics to CloudWatch under the AWS/ElasticMapReduce namespace. Metrics are collected and published every five minutes at no extra charge. There is no charge for the default EMR metrics themselves, though custom metrics do incur standard CloudWatch pricing. Metric data points are archived for 63 days.
On EMR release version 7.0.0 and later, you can install the CloudWatch Agent as an application, which reduces the collection interval from five minutes to one minute, providing much finer granularity for critical workloads.
Key CloudWatch Metrics Reference
The following table lists the most operationally important CloudWatch metrics for aws emr monitoring:
| Metric | Category | What It Signals |
|---|---|---|
| IsIdle | Cluster Status | Cluster is live but running no tasks (billing waste risk) |
| MRUnhealthyNodes | Node Status | One or more nodes out of disk space or in UNHEALTHY YARN state |
| MRLostNodes | Node Status | Nodes unable to communicate with the primary node |
| HDFSUtilization | Storage / IO | Percentage of total HDFS capacity in use |
| ContainerPendingRatio | Cluster Progress | Ratio of queued containers to allocated containers |
| AppsFailed | Cluster Health | Number of YARN applications that failed to complete |
| YARNMemoryAvailablePercentage | Memory | Percentage of YARN memory still available for allocation |
| CapacityRemainingGB | Storage / IO | Remaining HDFS disk capacity in GB |
| CoreNodesRunning | Node Status | Number of active core nodes processing tasks |
| MissingBlocks | Storage / IO | HDFS blocks with no replicas (potential data loss indicator) |
Setting CloudWatch Alarms
Metrics are only useful when they trigger action. The following are the most critical alarms to configure for any production EMR cluster:
- IsIdle alarm: Set the threshold to 1 for two or more consecutive five-minute periods (30 minutes or more). This catches clusters that are running but not processing work, which means you are paying for an idle cluster.
- MRUnhealthyNodes alarm: Alert when greater than zero. Even a single unhealthy node reduces cluster capacity and can stall shuffle operations.
- HDFSUtilization alarm: Alert at 80% to give your team time to add core nodes or clean up temporary data before HDFS fills up completely.
- AppsFailed alarm: Alert on any non-zero value to catch application failures in real time.
- ContainerPendingRatio alarm: Use this metric to drive auto-scaling. A rising ratio means the cluster cannot allocate containers fast enough for the current workload.
4. Monitoring EMR Cluster and Instance Health
Amazon EMR clusters are composed of three node types, and performance issues at any layer affect the whole cluster:
- Primary node (master node) – Manages the cluster and runs the YARN ResourceManager and HDFS NameNode. If this node has a performance issue, the entire cluster is affected.
- Core nodes – Process MapReduce tasks and host HDFS data. Removing a core node shrinks HDFS, so you can add core nodes to a running cluster but cannot remove them safely.
- Task nodes – Purely computational. They process tasks but do not store HDFS data. You can add or remove task nodes freely, making them ideal candidates for Spot Instance use.
Beyond CloudWatch metrics, you can check EC2-level health from the Amazon EC2 console. Because each EMR node runs on an EC2 instance, EC2 status checks (system reachability and instance reachability) give you low-level visibility into hardware and hypervisor issues that CloudWatch metrics alone would not reveal.
5. Monitoring Job Stages with Application UIs
Persistent Application UIs
Starting with Amazon EMR 5.25.0 and later, AWS hosts off-cluster, persistent versions of the following application UIs. These are accessible directly from the EMR console without an SSH tunnel or web proxy:
- Spark History Server – Provides a detailed breakdown of completed Spark jobs including individual stages, tasks, executor logs, and shuffle metrics.
- YARN Timeline Server – Shows resource allocation across all YARN applications and tracks application IDs.
- Tez UI (EMR 6.x and later) – Available for Hive and Tez workloads running on EMR 6.x clusters.
Application history is retained for 30 days after cluster termination. This is particularly valuable for post-mortems on clusters that terminated unexpectedly.
The Steps Tab
The Steps tab in the EMR console provides a high-level view of every piece of work submitted to the cluster. Each step moves through the following states: Pending, Running, Completed, or Failed. When a step fails, you can expand it to view the exit code and navigate directly to the step logs stored in S3 or, with CloudWatch log streaming enabled, in CloudWatch Logs.
Hadoop Web Interfaces
For clusters where you have SSH access or an SSH tunnel configured, the following Hadoop web interfaces provide deep job-level visibility:
- JobTracker – Tracks the progress of individual MapReduce jobs. Use it to identify when a job has stalled.
- HDFS NameNode – Shows per-node HDFS utilization and remaining space. This is the fastest way to identify which specific node is running low on disk.
- TaskTracker – Displays running tasks and their progress on each node. Use it to identify stuck tasks.
6. Monitoring Spark Jobs on Amazon EMR
Publishing Spark Metrics to CloudWatch
By default, Amazon EMR sends basic cluster metrics to CloudWatch. To get Spark-level metrics including stage and task detail, you need to configure a custom CloudWatch sink. AWS provides a detailed walkthrough and a CloudFormation template for this setup.
The solution works as follows: a configurable metrics library on each EC2 node captures Spark metrics and writes them to a local CloudWatch Agent, which aggregates and publishes them to a custom CloudWatch namespace (EMRCustomSparkCloudWatchSink for EMR 6.x, or CWAgent for EMR 7.x). A CloudWatch dashboard then provides instant insight into job performance.
The Metricfilter.json file controls which Spark metric namespaces are captured. Key categories to include are:
- Data I/O metrics
- Garbage collection (GC) duration and frequency per executor
- Memory and CPU pressure metrics
- appStatus metrics for Spark job, stage, and task counts (available from Spark 3.0)
Monitoring Spark Streaming with SparkListeners
For real-time streaming applications, the Spark metrics system alone is insufficient because it does not expose micro-batch level timing. The SparkStreaming interface and SparkListener trait give you the ability to capture metrics at the batch level and push them to CloudWatch as custom metrics.
Key metrics you can extract per micro-batch include:
- Scheduling delay – Time between when a batch was scheduled and when it actually started. A growing scheduling delay signals that the cluster cannot keep up with the input stream.
- Processing delay – How long the batch took to execute.
- Total delay – The sum of scheduling delay and processing delay.
- Records per batch – Number of records processed in the batch.
- Receiver errors – Number of receiver failures.
Once these custom metrics are in CloudWatch, you can configure alarms to fire when processingDelay approaches your batchInterval, which is the primary signal that a streaming application is falling behind.
Monitoring with the Spark UI
The Spark UI (available live during job execution and historically via the Spark History Server) provides the most granular view of Spark job execution. The Stages tab breaks down each stage by the number of tasks, task duration distributions, shuffle read/write size, and GC time. The Executors tab shows memory usage, active tasks, and total input/output per executor.
For Spark Streaming applications, the Streaming tab in the Spark UI shows the batch processing time and scheduling delay for each micro-batch, making it the fastest way to identify when a streaming job is starting to fall behind its input rate.
7. Centralize EMR Step Logs in CloudWatch Logs
By default, EMR step logs are stored in Amazon S3. This means you must wait for the cluster to finish, navigate to S3, and manually inspect log files. Streaming step logs to CloudWatch Logs in real time solves this problem.
The process involves installing the CloudWatch Agent on each EMR EC2 node via a bootstrap action and pointing it at the EMR step log directories. Once configured, logs stream in near-real time to CloudWatch Logs, where you can use CloudWatch Logs Insights to query across all step logs with SQL-like syntax.
For EMR 7.0.0 and later, the CloudWatch Agent is available as a native EMR application, removing the need for a bootstrap script.
8. Custom CloudWatch Metrics for EMR
Beyond what EMR pushes by default, you can publish any application-level metric to CloudWatch using the CloudWatch Agent with a custom configuration file. AWS provides a sample bootstrap script and config.json that you deploy to S3 and attach as a bootstrap action.
A typical custom metric configuration collects:
- cpu_usage_idle, cpu_usage_iowait, cpu_usage_user, cpu_usage_system via the cpu plugin
- used_percent, inodes_free via the disk plugin
- mem_used_percent via the mem plugin
- collectd or StatsD metrics for application-level instrumentation
Custom metrics appear under the CWAgent namespace by default. You can change the namespace in the config.json file. Once published, you can set CloudWatch alarms on these custom metrics or include them in CloudWatch dashboards alongside the default EMR metrics.
9. Monitoring AWS EMR at Scale: Multi-Cluster Visibility
Teams running more than a handful of EMR clusters or using EMR as part of a larger Step Functions pipeline often need a centralized view across all jobs. Two practical approaches are:
- CloudWatch + S3 + Athena/Grafana: Configure Step Functions to emit state change events to CloudWatch. Export CloudWatch metrics and logs to S3 using Kinesis Data Firehose or scheduled Lambda functions. Use AWS Glue to crawl the S3 data and Amazon Athena to query it. Build a Grafana or Amazon QuickSight dashboard that joins Step Function execution data with EMR job metrics.
- Apache Airflow: If you use Apache Airflow for EMR orchestration, Airflow provides built-in task-level monitoring and retry management. The Airflow UI shows the DAG execution tree, task duration, and failure history, giving you a workflow-centric view that complements the cluster-centric view from CloudWatch.
10. Monitoring Tools Summary
| Monitoring Layer | Primary Tool | Key Use Case |
|---|---|---|
| Cluster Infrastructure | Amazon CloudWatch Metrics | High-level health: lost nodes, HDFS usage, CPU/memory |
| State Changes and Automation | CloudWatch Events / EventBridge | Trigger Lambda or SNS on cluster or step state changes |
| Running Application Logic | Spark UI / YARN Timeline Server | Real-time stage breakdown, task progress, executor logs |
| Historical Analysis | Persistent Application UIs | Post-execution debugging for up to 30 days |
| Custom Spark Metrics | CloudWatch Custom Namespace | Stage/task metrics pushed via configurable CloudWatch sink |
| Deep Observability | Prometheus + Grafana | JMX, OS, HDFS, and YARN metrics with alerting dashboards |
| Third-Party APM | CubeAPM/Datadog | Unified view across infrastructure and Spark application layers |
| Log Centralization | CloudWatch Logs via CloudWatch Agent | EMR step logs streamed from EC2 nodes to CloudWatch Logs |
13. Common Performance Issues and How to Detect Them
Resource Contention
Symptoms: High YARNMemoryAvailablePercentage depletion, ContainerPending consistently greater than zero, tasks taking longer than baseline.
Detection: Set a CloudWatch alarm on YARNMemoryAvailablePercentage below 20%. Check the YARN Resource Manager dashboard for container allocation vs. pending counts.
Resolution: Add task nodes (they can be added and removed without affecting HDFS). Use Managed Scaling to automate this.
Data Skew
Symptoms: Most tasks in a stage complete quickly but a few run for 10x longer. High shuffle read on specific executors visible in Spark UI Stages tab.
Detection: Check the Spark UI Stage Detail page and look for tasks with significantly higher shuffle read/write than the median. In Grafana or CloudWatch custom dashboards, watch for executor-level memory imbalance.
Resolution: Use Spark’s repartition() or salt the join keys to redistribute data. Enable adaptive query execution (AQE) in Spark 3.x clusters.
Spot Instance Interruptions
Symptoms: MRLostNodes spikes, running steps fail, and the cluster recovers slowly.
Detection: CloudWatch Events will emit an EC2 Spot interruption notice two minutes before termination. Set an EventBridge rule that triggers a Lambda function to checkpoint the job or notify your on-call team.
Resolution: Use instance fleets with a mix of On-Demand and Spot Instances. For critical workloads, pin the primary and core nodes to On-Demand and use Spot only for task nodes.
HDFS Filling Up
Symptoms: HDFSUtilization rising toward 100%, CapacityRemainingGB trending toward zero, jobs failing with storage-related errors.
Detection: Alarm on HDFSUtilization above 80%. Check the HDFS NameNode web UI to see which directories are consuming the most space.
Resolution: Add core nodes to increase HDFS capacity. Clean up temporary shuffle data and unused output directories.
14. EMR Monitoring Best Practices
- Enable the CloudWatch Agent on EMR 7.x to reduce the metric collection interval from five minutes to one minute for latency-sensitive production workloads.
- Always enable log archiving to S3 when you create a cluster. This preserves logs even after cluster termination, which is critical for debugging failures.
- Use EventBridge rules for lifecycle automation. A rule that fires on TERMINATED_WITH_ERRORS can automatically page your team or trigger a retry workflow via Step Functions.
- Create CloudWatch dashboards per environment (development, staging, production) so that you can quickly compare baselines across environments.
- For production Spark jobs, configure the custom CloudWatch sink to capture stage and task metrics. The default five-minute cluster metrics do not provide enough granularity to diagnose stage-level bottlenecks.
- Monitor your source streams in addition to EMR. For Kafka-backed streaming applications, track consumer lag. For Kinesis, watch IteratorAge. A healthy EMR cluster with a stalled upstream source will still look idle from the cluster metrics perspective.
- Use Managed Scaling with CloudWatch alarms on ContainerPendingRatio to automate cluster resizing based on actual workload demand rather than static schedules.
- Test your alerting before production launch. Manually introduce an idle cluster or fill a test HDFS volume and confirm that your CloudWatch alarms fire correctly.
Amazon EMR Monitoring with CubeAPM
CubeAPM gives you application performance monitoring tailored for distributed data workloads running on Amazon EMR. Correlate EMR cluster metrics, Spark job stages, task failures, and application traces in a single pane of glass so your team spends less time pivoting between dashboards and more time shipping.
With CubeAPM you can:
- Pinpoint slow Spark stages and skewed tasks before they breach your SLA
- Get alerted on unhealthy or lost nodes the moment they degrade cluster throughput
- Trace a slow query end-to-end from the application layer to the HDFS block level
- Reduce idle cluster time with smart cost-aware alerting
Related Reading
If you found this guide useful, these resources cover related AWS and infrastructure monitoring topics:
Key Lambda metrics for serverless workloads that often sit alongside EMR in data pipelines.
Explains Kubernetes object-state metrics that are relevant if you run EMR on EKS.
A practical guide to container log collection, applicable to EMR on EKS workloads.
Conclusion
Effective AWS EMR monitoring means covering both planes: the cluster infrastructure layer with CloudWatch alarms on IsIdle, MRUnhealthyNodes, HDFSUtilization, and AppsFailed, and the application layer with a persistent Spark History Server and custom CloudWatch sinks for stage-level visibility. Start with the basics in the EMR console and CloudWatch, then layer in Prometheus, Grafana, or Datadog as your workloads grow.
Disclaimer: This article contains pricing estimates based on publicly available AWS CloudWatch Logs rates as of May 2026. Actual costs may vary by AWS region, account type, and usage patterns. Always verify current pricing before making infrastructure decisions.
FAQs
1. How often does Amazon EMR send metrics to CloudWatch?
By default, EMR pushes metrics to CloudWatch every five minutes. On EMR release 7.0.0 and later, installing the CloudWatch Agent as an EMR application reduces this to one minute. There is no charge for the default EMR metrics published to CloudWatch.
2. How do I monitor a specific Spark job stage in Amazon EMR?
Open the Spark History Server from the Application UIs tab in the EMR console. The Stages tab breaks down each stage by task count, task duration, shuffle read/write size, and GC time. For real-time analysis on a running job, access the live Spark UI via the same tab. Both interfaces are available without an SSH tunnel starting with EMR 5.25.0.
3. What is the IsIdle metric in AWS EMR monitoring and why does it matter?
The IsIdle metric is set to 1 when a cluster has no running tasks and no running jobs. It is checked every five minutes. An idle cluster is still alive and accruing EC2 charges, which makes it one of the most common sources of unexpected EMR spend. Set a CloudWatch alarm to alert when IsIdle equals 1 for 30 or more consecutive minutes.
4. Can I monitor EMR cluster metrics after the cluster terminates?
Yes. The persistent application UIs in the EMR console (Spark History Server, YARN Timeline Server, Tez UI) retain job history for 30 days after cluster termination. CloudWatch metrics are archived for 63 days. If you enabled S3 log archiving when you created the cluster, step and application logs remain available in S3 indefinitely.
5. What is the difference between CloudWatch metrics and custom Spark metrics in EMR?
Default CloudWatch metrics (published under AWS/ElasticMapReduce) cover cluster-level signals such as node health, HDFS utilization, and YARN container counts. They do not expose Spark-internal signals like individual stage duration, task failure counts, or executor GC time. To get those, you need to configure a custom CloudWatch sink with a Metricfilter.json file and deploy it via a bootstrap action. The resulting metrics appear under a custom namespace such as EMRCustomSparkCloudWatchSink and can be used to build per-job dashboards and alarms.





