

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 監控 AWS Glue Spark 任務
<a name="monitor-spark"></a>

**Topics**
+ [中可用的 Spark 指標 AWS Glue Studio](#console-jobs-details-metrics-spark)
+ [使用 Apache Spark web UI 監控任務](monitor-spark-ui.md)
+ [使用 AWS Glue 任務執行洞察進行監控](monitor-job-insights.md)
+ [使用 Amazon CloudWatch 監控](monitor-cloudwatch.md)
+ [任務監控與偵錯](monitor-profile-glue-job-cloudwatch-metrics.md)

## 中可用的 Spark 指標 AWS Glue Studio
<a name="console-jobs-details-metrics-spark"></a>

**Metrics (指標)** 索引標籤會顯示在任務執行時和分析功能開啟時，所收集到的指標。Spark 任務中會顯示下列圖表：
+ ETL 資料移動
+ 記憶體使用狀況：驅動程式和執行器

選擇 **View additional metrics (檢視其他指標)**，來顯示下列的圖表：
+ ETL 資料移動
+ 記憶體使用狀況：驅動程式和執行器
+ 在執行器之間的資料隨機移動
+ CPU 負載：驅動程式和執行器
+ 任務執行：運作中的執行器、已完成的階段和所需執行器的數量上限

如果任務已啟用收集指標，則這些圖表的資料會推送到 CloudWatch 指標。如需如何開啟指標和解讀圖表的詳細資訊，請參閱 [任務監控與偵錯](monitor-profile-glue-job-cloudwatch-metrics.md)。

**Example ETL 資料移動圖表**  
ETL 資料移動圖表顯示下列指標：  
+ 所有執行器從 Amazon S3 讀取的位元組數量—[`glue.ALL.s3.filesystem.read_bytes`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.ALL.s3.filesystem.read_bytes)
+ 所有執行器寫入至 Amazon S3 位元組數量—[`glue.ALL.s3.filesystem.write_bytes`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.ALL.s3.filesystem.write_bytes)

![\[ETL 資料移動圖表 (位於 AWS Glue 主控台的「指標」索引標籤中)。\]](http://docs.aws.amazon.com/zh_tw/glue/latest/dg/images/job_detailed_etl.png)


**Example 記憶體使用狀況圖表**  
記憶體使用狀況圖表顯示下列指標：  
+ 此驅動程式的 JVM 堆疊所使用的記憶體佔比 (比例：0-1)，依驅動程式、由 *executorId* 所辨識的執行器，或所有執行器劃分 —
  + [`glue.driver.jvm.heap.usage`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.jvm.heap.usage)
  + [`glue.executorId.jvm.heap.usage`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.executorId.jvm.heap.usage)
  + [`glue.ALL.jvm.heap.usage`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.ALL.jvm.heap.usage)

![\[記憶體使用狀況圖表 (位於 AWS Glue 主控台的「指標」索引標籤中)。\]](http://docs.aws.amazon.com/zh_tw/glue/latest/dg/images/job_detailed_mem.png)


**Example 執行器之間的資料隨機移動圖表**  
執行器之間的資料隨機移動圖表顯示下列指標：  
+ 所有執行器讀取的位元組數量 (以在這些執行器之間隨機移動資料) — [`glue.driver.aggregate.shuffleLocalBytesRead`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.aggregate.shuffleLocalBytesRead)
+ 所有執行器寫入的位元組數量 (以在這些執行器之間隨機移動資料) — [`glue.driver.aggregate.shuffleBytesWritten`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.aggregate.shuffleBytesWritten)

![\[執行器之間的資料隨機移動圖表 (位於 AWS Glue 主控台的「指標」索引標籤中)。\]](http://docs.aws.amazon.com/zh_tw/glue/latest/dg/images/job_detailed_data.png)


**Example CPU 負載圖表**  
CPU 負載圖表顯示下列指標：  
+ 驅動程式、由 *executorId* 所辨識的執行器，或所有執行器使用的 CPU 系統負載佔比 (比例：0-1) —
  + [`glue.driver.system.cpuSystemLoad`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.system.cpuSystemLoad)
  + [`glue.executorId.system.cpuSystemLoad`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.executorId.system.cpuSystemLoad)
  + [`glue.ALL.system.cpuSystemLoad`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.ALL.system.cpuSystemLoad)

![\[CPU 負載圖表 (位於 AWS Glue 主控台的「指標」索引標籤中)。\]](http://docs.aws.amazon.com/zh_tw/glue/latest/dg/images/job_detailed_cpu.png)


**Example 任務執行圖表**  
任務執行圖表顯示下列指標：  
+ 目前正在運作中執行器的數量 — [`glue.driver.ExecutorAllocationManager.executors.numberAllExecutors`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.ExecutorAllocationManager.executors.numberAllExecutors)
+ 已完成階段的數量 — [`glue.aggregate.numCompletedStages`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.aggregate.numCompletedStages)
+ 所需執行器數量的上限 — [`glue.driver.ExecutorAllocationManager.executors.numberMaxNeededExecutors`](monitoring-awsglue-with-cloudwatch-metrics.md#glue.driver.ExecutorAllocationManager.executors.numberMaxNeededExecutors)

![\[任務執行圖表 (位於 AWS Glue 主控台的「指標」索引標籤中)。\]](http://docs.aws.amazon.com/zh_tw/glue/latest/dg/images/job_detailed_exec.png)
