本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
CloudWatch 中的 Apache Airflow 環境指標
Apache Airflow v2 和 v3 已設定為收集 StatsD
內容
條款
- 命名空間
-
命名空間是 AWS 服務的 CloudWatch 指標的容器。對於 Amazon MWAA,命名空間為 AmazonMWAA。
- CloudWatch 指標
-
CloudWatch 指標代表 CloudWatch 特有的一組按時間順序排列的資料點。
- Apache Airflow 指標
-
Apache Airflow 特有的指標
。 - 維度
-
維度是一組名稱值對,是指標身分的一部分。
- 單位
-
統計資料具有度量單位。對於 Amazon MWAA,單位包括計數、秒和毫秒。對於 Amazon MWAA,單位是根據原始 Airflow 指標中的單位設定。
Dimensions (尺寸)
本節說明 CloudWatch 中 Apache Airflow 指標的 CloudWatch Dimensions 分組。
| 維度 | 描述 |
|---|---|
|
DAG |
指出特定的 Apache Airflow DAG 名稱。 |
|
DAG 檔案名稱 |
指出特定的 Apache Airflow DAG 檔案名稱。 |
|
函式 |
此維度用於改善 CloudWatch 中指標的分組。 |
|
任務 |
指出排程器執行的 Apache Airflow 任務。值一律為 |
|
運算子 |
指出特定的 Apache Airflow 運算子。 |
|
集區 |
指出特定的 Apache Airflow 工作者集區。 |
|
任務 |
指出特定的 Apache Airflow 任務。 |
|
HostName |
指出特定執行中 Apache Airflow 程序的主機名稱。 |
在 CloudWatch 主控台中存取指標
本節說明如何存取 CloudWatch 中特定 DAG 的效能指標。
存取維度的效能指標
-
在 CloudWatch 主控台上開啟指標頁面
。 -
選取您的 AWS 區域。
-
選擇 AmazonMWAA 命名空間。
-
在所有指標索引標籤中,選取維度。例如 DAG、Environment。
-
選擇維度的 CloudWatch 指標。例如,TaskInstanceSuccesses 或 TaskInstanceDuration。選擇繪製所有搜尋結果的圖形。
-
選擇圖形化指標索引標籤,以存取 Apache Airflow 指標的效能統計資料,例如 DAG、環境、任務。
CloudWatch 中可用的 Apache Airflow 指標
本節說明傳送至 CloudWatch 的 Apache Airflow 指標和維度。
Apache Airflow 計數器
本節中的 Apache Airflow 指標包含有關 Apache Airflow 計數器
| CloudWatch 指標 | Apache Airflow 指標 | 單位 | 維度 |
|---|---|---|---|
|
SLAMissed 注意僅適用於 Apache Airflow v2.4.3 到 v2.10.3。 |
sla_missed |
計數 |
函數、排程器 |
|
FailedSLACallback 注意僅適用於 Apache Airflow v2.4.3 到 v2.10.3。 |
sla_callback_notification_failure |
計數 |
函數、排程器 |
|
更新 注意適用於 Apache Airflow 2.6.3 版及更新版本。 |
dataset.updates |
計數 |
函數、排程器 |
|
孤立 注意適用於 Apache Airflow 2.6.3 版及更新版本。 |
dataset.orphaned |
計數 |
函數、排程器 |
|
FailedCeleryTaskExecution 注意適用於 Apache Airflow 2.4.3 版及更新版本。 |
celery.execute_command.failure |
計數 |
函數、Celery |
|
FilePathQueueUpdateCount 注意適用於 Apache Airflow 2.6.3 版及更新版本。 |
dag_processing.file_path_queue_update_count |
計數 |
函數、排程器 |
|
CriticalSectionBusy |
scheduler.critical_section_busy |
計數 |
函數、排程器 |
|
DagBagSize |
dagbag_size |
計數 |
函數、DAG 處理 |
|
DagCallbackExceptions |
dag.callback_exceptions |
計數 |
DAG,全部 |
|
FailedSLAEmailAttempts 注意不適用於 Apache Airflow v3.0.6 和更新版本。 |
sla_email_notification_failure |
計數 |
函數、排程器 |
|
TaskInstanceFinished |
ti.finish.{dag_id}.{task_id}.{state} |
計數 |
DAG、{dag_id} 任務,{task_id} 狀態,{state} |
|
JobEnd |
{job_name}_end |
計數 |
任務,{job_name} |
|
JobHeartbeatFailure |
{job_name}_heartbeat_failure |
計數 |
任務,{job_name} |
|
JobStart |
{job_name}_start |
計數 |
任務,{job_name} |
|
ManagerStalls |
dag_processing.manager_stalls |
計數 |
函數、DAG 處理 |
|
OperatorFailures |
Operator_failures_{operator_name} |
計數 |
Operator, {operator_name} |
|
OperatorSuccesses |
Operator_successes_{operator_name} |
計數 |
Operator, {operator_name} |
|
OtherCallbackCount 注意Apache Airflow 2.6.3 版及更新版本中提供。 |
dag_processing.other_callback_count |
計數 |
函數、排程器 |
|
Processes |
dag_processing.processes |
計數 |
函數、DAG 處理 |
|
SchedulerHeartbeat |
scheduler_heartbeat |
計數 |
函數、排程器 |
|
StartedTaskInstances |
ti.start.{dag_id}.{task_id} |
計數 |
DAG,全部 任務,全部 |
|
SlaCallbackCount |
dag_processing.sla_callback_count 注意適用於 Apache Airflow 2.6.3 版及更新版本。 |
計數 |
函數、排程器 |
|
TasksKilledExternally |
scheduler.tasks.killed_externally |
計數 |
函數、排程器 |
|
TaskTimeoutError |
celery.task_timeout_error |
計數 |
函數、Celery |
|
TaskInstanceCreatedUsingOperator |
task_instance_created-{operator_name} |
計數 |
Operator, {operator_name} |
|
TaskInstancePreviouslySucceeded |
previously_succeeded |
計數 |
DAG,全部 任務,全部 |
|
TaskInstanceFailures |
ti_failures |
計數 |
DAG,全部 任務,全部 |
|
TaskInstanceSuccesses |
ti_successes |
計數 |
DAG,全部 任務,全部 |
|
TaskRemovedFromDAG |
task_removed_from_dag.{dag_id} |
計數 |
DAG、{dag_id} |
|
TaskRestoredToDAG |
task_restored_to_dag.{dag_id} |
計數 |
DAG、{dag_id} |
|
TriggersSucceeded 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
triggers.succeeded |
計數 |
函數、觸發 |
|
TriggersFailed 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
triggers.failed |
計數 |
函數、觸發 |
|
TriggersBlockedMainThread 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
triggers.blocked_main_thread |
計數 |
函數、觸發 |
|
TriggerHeartbeat 注意適用於 Apache Airflow 2.8.1 版及更新版本。 |
triggerer_heartbeat |
計數 |
函數、觸發器 |
|
TaskInstanceCreatedUsingOperator |
airflow.task_instance_created_ 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
計數 |
運算子、 |
|
ZombiesKilled |
zombies_killed |
計數 |
DAG,全部 任務,全部 |
Apache Airflow 量測器
本節中的 Apache Airflow 指標包含有關 Apache Airflow 量測計
| CloudWatch 指標 | Apache Airflow 指標 | 單位 | 維度 |
|---|---|---|---|
|
DAGFileRefreshError |
dag_file_refresh_error |
計數 |
函數、DAG 處理 |
|
ImportErrors |
dag_processing.import_errors |
計數 |
函數、DAG 處理 |
|
ExceptionFailures |
smart_sensor_operator.exception_failures |
計數 |
函數、智慧感應器運算子 |
|
ExecutedTasks |
smart_sensor_operator.executed_tasks |
計數 |
函數、智慧感應器運算子 |
|
InfraFailures |
smart_sensor_operator.infra_failures |
計數 |
函數、智慧感應器運算子 |
|
LoadedTasks |
smart_sensor_operator.loaded_tasks |
計數 |
函數、智慧感應器運算子 |
|
TotalParseTime |
dag_processing.total_parse_time |
秒鐘 |
函數、DAG 處理 |
|
TriggeredDagRuns 注意Apache Airflow 2.6.3 版及更新版本中提供。 |
dataset.triggered_dagruns |
計數 |
函數、排程器 |
|
TriggersRunning 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
triggers.running. |
計數 |
函數、觸發 HostName、 |
|
PoolDeferredSlots 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
pool.deferred_slots。 |
計數 |
集區,{pool_name} |
|
DAGFileProcessingLastRunSecondsAgo |
dag_processing.last_run.seconds_ago.{dag_filename} |
秒鐘 |
DAG 檔案名稱,{dag_filename} |
|
OpenSlots |
executor.open_slots |
計數 |
函數、執行器 |
|
OrphanedTasksAdopted |
scheduler.orphaned_tasks.adopted |
計數 |
函數、排程器 |
|
OrphanedTasksCleared |
scheduler.orphaned_tasks.cleared |
計數 |
函數、排程器 |
|
PokedExceptions |
smart_sensor_operator.poked_exception |
計數 |
函數、智慧感應器運算子 |
|
PokedSuccess |
smart_sensor_operator.poked_success |
計數 |
函數、智慧感應器運算子 |
|
PokedTasks |
smart_sensor_operator.poked_tasks |
計數 |
函數、智慧感應器運算子 |
|
PoolFailures |
pool.open_slots.{pool_name} |
計數 |
集區,{pool_name} |
|
PoolStarvingTasks |
pool.starving_tasks.{pool_name} |
計數 |
集區,{pool_name} |
|
PoolOpenSlots |
pool.open_slots.{pool_name} |
計數 |
集區,{pool_name} |
|
PoolQueuedSlots |
pool.queued_slots.{pool_name} |
計數 |
集區,{pool_name} |
|
PoolRunningSlots |
pool.running_slots.{pool_name} |
計數 |
集區,{pool_name} |
|
ProcessorTimeouts |
dag_processing.processor_timeouts |
計數 |
函數、DAG 處理 |
|
QueuedTasks |
executor.queued_tasks |
計數 |
函數、執行器 |
|
RunningTasks |
executor.running_tasks |
計數 |
函數、執行器 |
|
TasksExecutable |
scheduler.tasks.executable |
計數 |
函數、排程器 |
|
TasksPending 注意不適用於 Apache Airflow v2.2 和更新版本。 |
scheduler.tasks.pending |
計數 |
函數、排程器 |
|
TasksRunning |
scheduler.tasks.running |
計數 |
函數、排程器 |
|
TasksStarving |
scheduler.tasks.starving |
計數 |
函數、排程器 |
|
TasksWithoutDagRun |
scheduler.tasks.without_dagrun |
計數 |
函數、排程器 |
|
DAGFileProcessingLastNumOfDbQueries 注意適用於 Apache Airflow 2.10.1 版及更新版本。 |
dag_processing.last_num_of_db_queries.{dag_filename} |
計數 |
DAG 檔案名稱,{dag_filename} |
|
PoolScheduledSlots 注意適用於 Apache Airflow 2.10.1 版及更新版本。 |
pool.scheduled_slots.{pool_name} |
計數 |
集區,{pool_name} |
|
TaskCpuUsage 注意Apache Airflow 2.10.1 版及更新版本中提供。 |
cpu.usage.{dag_id}.{task_id} |
百分比 |
DAG、{dag_id} 任務,{task_id} |
|
TaskMemoryUsage 注意Apache Airflow 2.10.1 版及更新版本中提供。 |
mem.usage.{dag_id}.{task_id} |
百分比 |
DAG、{dag_id} 任務,{task_id} |
Apache Airflow 計時器
本節中的 Apache Airflow 指標包含有關 Apache Airflow 計時器
| CloudWatch 指標 | Apache Airflow 指標 | 單位 | 維度 |
|---|---|---|---|
|
CollectDBDags |
collect_db_dags |
毫秒 |
函數、DAG 處理 |
|
CriticalSectionDuration |
scheduler.critical_section_duration |
毫秒 |
函數、排程器 |
|
CriticalSectionQueryDuration 注意適用於 Apache Airflow 2.5.1 版及更新版本。 |
scheduler.critical_section_query_duration |
毫秒 |
函數、排程器 |
|
DAGDependencyCheck |
dagrun.dependency-check.{dag_id} |
毫秒 |
DAG、{dag_id} |
|
DAGDurationFailed |
dagrun.duration.failed.{dag_id} |
毫秒 |
DAG、{dag_id} |
|
DAGDurationSuccess |
dagrun.duration.success.{dag_id} |
毫秒 |
DAG、{dag_id} |
|
DAGFileProcessingLastDuration |
dag_processing.last_duration.{dag_filename} |
秒鐘 |
DAG 檔案名稱,{dag_filename} |
|
DAGScheduleDelay |
dagrun.schedule_delay.{dag_id} |
毫秒 |
DAG、{dag_id} |
|
FirstTaskSchedulingDelay |
dagrun.{dag_id}.first_task_scheduling_delay |
毫秒 |
DAG、{dag_id} |
|
SchedulerLoopDuration 注意適用於 Apache Airflow 2.5.1 版及更新版本。 |
scheduler.scheduler_loop_duration |
毫秒 |
函數、排程器 |
|
TaskInstanceDuration |
dag.{dag_id}.{task_id}.duration |
毫秒 |
DAG、{dag_id} 任務,{task_id} |
|
TaskInstanceQueuedDuration |
dag. 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
毫秒 |
DAG、{dag_id} 任務,{task_id} |
|
TaskInstanceScheduledDuration 注意適用於 Apache Airflow 2.7.2 版及更新版本。 |
dag. |
毫秒 |
DAG、{dag_id} 任務,{task_id} |
選擇報告哪些指標
您可以使用下列 Amazon MWAA 組態選項,選擇向 CloudWatch 發出或由 Apache Airflow 封鎖的 Apache Airflow 指標:
metrics.metrics_allow_list— 逗號分隔的字首清單,可用來選取環境向 CloudWatch 發出的指標。如果您希望 Apache Airflow 不傳送所有可用的指標,而是選取元素子集,請使用此選項。例如scheduler,executor,dagrun。metrics.metrics_block_list— 逗號分隔字首清單,用於篩選以清單元素開頭的指標。例如scheduler,executor,dagrun。
如果您同時設定 metrics.metrics_allow_list和 metrics.metrics_block_list,Apache Airflow 會忽略 metrics.metrics_block_list。如果您設定 metrics.metrics_block_list 但未設定 metrics.metrics_allow_list,Apache Airflow 會篩選掉您在 中指定的元素metrics.metrics_block_list。
注意
metrics.metrics_allow_list 和 metrics.metrics_block_list組態選項僅適用於 Apache Airflow v2.6.3 和更新版本。對於舊版 Apache Airflow,請metrics.statsd_block_list改用 metrics.statsd_allow_list和 。
後續步驟?
-
探索用於在 PublishMetrics 發佈環境運作狀態指標的 Amazon MWAA API 操作。