工作流程協調流程管理員的診斷記錄和計量
注意
工作流程協調流程管理員由 Apache Airflow 提供。
本文將逐步引導您完成下列步驟:
- 在 Azure Data Factory 中啟用工作流程協調流程管理員的診斷記錄和計量。
- 檢視記錄和計量。
- 執行查詢。
- 監視計量,並在有向無循環圖 (DAG) 失敗中設定警示系統。
必要條件
您需要訂閱 Azure。 如果您沒有 Azure 訂用帳戶,請在開始前建立免費 Azure 帳戶。
啟用工作流程協調流程管理員的診斷記錄和計量
開啟 Data Factory 資源,然後選取 最左邊窗格上的 [診斷設定 ]。 然後選取 [ 新增診斷設定]。
填寫診斷 設定 名稱。 針對 Airflow 記錄選取下列類別:
- Airflow 工作執行記錄
- Airflow 背景工作記錄
- Airflow DAG 處理記錄
- Airflow 排程器記錄
- Airflow Web 記錄
- 如果您選取 [AllMetrics],則會提供各種 Data Factory 計量供您監視或引發警示。 這些計量包括 Data Factory 活動的計量和工作流程協調流程管理員整合運行時間,例如
AirflowIntegrationRuntimeCpuUsage
和AirflowIntegrationRuntimeMemory
。
在 [目的地詳細資料] 底下,選取 [傳送至 Log Analytics 工作區] 核取方塊。
選取 [儲存]。
檢視記錄
新增診斷設定之後,您可以在 [ 診斷設定 ] 區段中找到它們。 若要存取和檢視記錄,請選取您設定的Log Analytics工作區。
在 [最大化 Log Analytics 體驗] 區段底下,選取 [檢視記錄]。
系統會將您導向至 Log Analytics 工作區,您可以在其中看到您選取的數據表已自動匯入工作區。
架構的其他實用連結:
- Azure 監視器記錄參考 - ADFAirflowSchedulerLogs |Microsoft Learn
- Azure 監視器記錄參考 - ADFAirflowTaskLogs |Microsoft Learn
- Azure 監視器記錄參考 - ADFAirflowWebLogs |Microsoft Learn
- Azure 監視器記錄參考 - ADFAirflowWorkerLogs |Microsoft Learn
- Azure 監視器記錄參考 - AirflowDagProcessingLogs |Microsoft Learn
撰寫查詢
讓我們從傳回 中
ADFAirflowTaskLogs
所有記錄的最簡單查詢開始。 您可以按兩下資料表名稱,將其新增至查詢視窗。 您也可以直接在視窗中輸入資料表名稱。若要縮小搜尋結果的範圍,例如根據特定工作標識碼進行篩選,您可以使用下列查詢:
ADFAirflowTaskLogs | where DagId == "<your_dag_id>" and TaskId == "<your_task_id>"
同樣地,您可以使用 中 LogManagement
可用的任何數據表,根據您的需求建立自定義查詢。
如需詳細資訊,請參閱
監視計量
Data Factory 提供 Airflow 整合運行時間的完整計量,可讓您有效地監視 Airflow 整合運行時間的效能,並視需要建立警示機制。
開啟 Data Factory 資源。
在最左邊的窗格中,選取 [監視] 區段 底下的 [計量]。
選取您想要監視的範圍>計量命名空間>計量。
檢視表。
您可以設定警示規則,以在計量符合特定條件時觸發。 如需詳細資訊,請參閱 Azure 監視器警示概觀。
在圖表完成後選取 [ 儲存到儀錶板 ],否則您的圖表就會消失。
空氣流量計量
下表列出工作流程協調流程管理員可用的計量。 表格標題如下:
- 計量:計量顯示名稱,如 Azure 入口網站 所示。
- REST API 中的名稱:REST API 中所指的計量名稱。
- 描述:計量的描述。
- 單位:量值單位。
- 匯總:預設匯總類型。 有效值為 Average、Minimum、Maximum、Total 和 Count。
- 維度:計量可用的維度。
- 時間粒紋:計量取樣的間隔。 例如,PT1M 表示計量每分鐘取樣一次、PT30M 每隔 30 分鐘、每小時 PT1H 等。
- DS 匯出:計量是否可透過診斷設定導出至 Azure 監視器記錄。
計量 | REST API 中的名稱 | 描述 | 單位 | 彙總 | 維度 | 時間粒紋 | DS 匯出 |
---|---|---|---|---|---|---|---|
Airflow Integration Runtime Celery 工作逾時錯誤 | AirflowIntegrationRuntimeCeleryTaskTimeoutError |
AirflowTaskTimeout 將工作發佈至 Celery Broker 時引發的錯誤數目。 |
計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間收集 DB Dags | AirflowIntegrationRuntimeCollectDBDags |
從資料庫擷取所有串行化 DAG 所花費的毫秒。 | 毫秒 | 平均 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Cpu 百分比 | AirflowIntegrationRuntimeCpuPercentage |
Airflow 整合運行時間的CPU使用量百分比。 | Percent | 平均 | IntegrationRuntimeName , ContainerName |
PT1M | No |
Airflow Integration Runtime Memory Usage | AirflowIntegrationRuntimeCpuUsage |
Airflow 整合運行時間所耗用的 Millicores,表示 CPU 核心數千分之一使用的 CPU 資源。 | 米利科雷斯 | 平均 | IntegrationRuntimeName , ContainerName |
PT1M | Yes |
Airflow Integration Runtime Dag Bag Size | AirflowIntegrationRuntimeDagBagSize |
排程器根據其設定執行掃描時找到的 DAG 數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間 Dag 回呼例外狀況 | AirflowIntegrationRuntimeDagCallbackExceptions |
從 DAG 回呼引發的例外狀況數目。 發生例外狀況時,表示DAG回呼無法運作。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime DAG 檔案重新整理錯誤 | AirflowIntegrationRuntimeDAGFileRefreshError |
載入任何 DAG 檔案的失敗次數。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime DAG 處理匯入錯誤 | AirflowIntegrationRuntimeDAGProcessingImportErrors |
嘗試剖析 DAG 檔案的錯誤數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間 DAG 處理上次持續時間 | AirflowIntegrationRuntimeDAGProcessingLastDuration |
載入特定 DAG 檔案所花費的秒數。 | 毫秒 | 平均 | IntegrationRuntimeName , DagFile |
PT1M | No |
Airflow 整合運行時間 DAG 處理上次執行秒前 | AirflowIntegrationRuntimeDAGProcessingLastRunSecondsAgo |
上次處理dag_file>后的<秒數。 | 秒 | 平均 | IntegrationRuntimeName , DagFile |
PT1M | No |
Airflow Integration Runtime DAG ProcessingManager 停滯 | AirflowIntegrationRuntimeDAGProcessingManagerStalls |
停滯 DagFileProcessorManager 的數目。 |
計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間 DAG 處理程式 | AirflowIntegrationRuntimeDAGProcessingProcesses |
目前執行 DAG 剖析進程的相對數目。 (例如,當上次傳送計量之後,進程已完成時,此差異為負數。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime DAG 處理處理器逾時 | AirflowIntegrationRuntimeDAGProcessingProcessorTimeouts |
已終止的檔案處理器數目,因為它們花費的時間太長。 | 秒 | 平均 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime DAG 處理總剖析時間 | AirflowIntegrationRuntimeDAGProcessingTotalParseTime |
掃描和匯入 dag_processing.file_path_queue_size DAG 檔案所花費的秒數。 |
秒 | 平均 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime DAG 執行相依性檢查 | AirflowIntegrationRuntimeDAGRunDependencyCheck |
檢查 DAG 相依性的毫秒。 | 毫秒 | 平均 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow Integration Runtime DAG 執行持續時間失敗 | AirflowIntegrationRuntimeDAGRunDurationFailed |
達到 DagRun 失敗狀態所花費的秒數。 |
毫秒 | 平均 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow Integration Runtime DAG 執行持續時間成功 | AirflowIntegrationRuntimeDAGRunDurationSuccess |
取得成功狀態所 DagRun 花費的秒數。 |
毫秒 | 平均 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow Integration Runtime DAG 執行第一個工作排程延遲 | AirflowIntegrationRuntimeDAGRunFirstTaskSchedulingDelay |
第一個工作 start_date 與 DagRun 預期的開始之間經過的秒數。 |
毫秒 | 平均 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow Integration Runtime DAG 執行排程延遲 | AirflowIntegrationRuntimeDAGRunScheduleDelay |
排程 DagRun 開始日期與實際 DagRun 開始日期之間的延遲秒。 |
毫秒 | 平均 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow Integration Runtime Executor Open Slots | AirflowIntegrationRuntimeExecutorOpenSlots |
執行程式上的開啟位置數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Executor Queued Tasks | AirflowIntegrationRuntimeExecutorQueuedTasks |
執行程式上已排入佇列的工作數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime 執行程序執行工作 | AirflowIntegrationRuntimeExecutorRunningTasks |
執行程式上執行的工作數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime 作業結束 | AirflowIntegrationRuntimeJobEnd |
結束 <job_name> 作業的數目,例如 SchedulerJob 和 LocalTaskJob 。 |
計數 | 總數 | IntegrationRuntimeName , Job |
PT1M | No |
Airflow Integration Runtime 活動訊號失敗 | AirflowIntegrationRuntimeJobHeartbeatFailure |
>job_name作業的失敗活動訊號<數目,例如 SchedulerJob 和 LocalTaskJob 。 |
計數 | 總數 | IntegrationRuntimeName , Job |
PT1M | No |
Airflow Integration Runtime 作業啟動 | AirflowIntegrationRuntimeJobStart |
啟動 <job_name> 作業的數目,例如 SchedulerJob 和 LocalTaskJob 。 |
計數 | 總數 | IntegrationRuntimeName , Job |
PT1M | No |
Airflow 整合運行時間記憶體百分比 | AirflowIntegrationRuntimeMemoryPercentage |
Airflow 整合運行時間環境所使用的記憶體百分比。 | Percent | 平均 | IntegrationRuntimeName , ContainerName |
PT1M | Yes |
Airflow 整合運行時間節點計數 | AirflowIntegrationRuntimeNodeCount |
計數 | 平均 | IntegrationRuntimeName , ComputeNodeSize |
PT1M | Yes | |
Airflow 整合運行時間操作員失敗 | AirflowIntegrationRuntimeOperatorFailures |
運算子失敗總數。 | 計數 | 總數 | IntegrationRuntimeName , Operator |
PT1M | No |
Airflow Integration Runtime 運算符成功 | AirflowIntegrationRuntimeOperatorSuccesses |
運算元成功總數。 | 計數 | 總數 | IntegrationRuntimeName , Operator |
PT1M | No |
Airflow Integration Runtime Pool Open Slots | AirflowIntegrationRuntimePoolOpenSlots |
集區中開啟的位置數目。 | 計數 | 總數 | IntegrationRuntimeName , Pool |
PT1M | No |
Airflow Integration Runtime Pool Queued Slots | AirflowIntegrationRuntimePoolQueuedSlots |
集區中的佇列位置數目。 | 計數 | 總數 | IntegrationRuntimeName , Pool |
PT1M | No |
Airflow 整合運行時間集區執行位置 | AirflowIntegrationRuntimePoolRunningSlots |
集區中執行中位置的數目。 | 計數 | 總數 | IntegrationRuntimeName , Pool |
PT1M | No |
Airflow 整合運行時間集區饑餓工作 | AirflowIntegrationRuntimePoolStarvingTasks |
集區中饑餓的工作數目。 | 計數 | 總數 | IntegrationRuntimeName , Pool |
PT1M | No |
Airflow 整合運行時間排程器重要區段忙碌中 | AirflowIntegrationRuntimeSchedulerCriticalSectionBusy |
排程器進程嘗試取得重要區段鎖定的次數計數(將工作傳送至執行程式所需的時間),並發現由另一個進程鎖定。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間排程器重大區段持續時間 | AirflowIntegrationRuntimeSchedulerCriticalSectionDuration |
排程器迴圈之關鍵區段所花費的毫秒數。 一次只能有單一排程器進入這個迴圈。 | 毫秒 | 平均 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Scheduler 失敗的 SLA 電子郵件嘗試 | AirflowIntegrationRuntimeSchedulerFailedSLAEmailAttempts |
失敗的 SLA 遺漏電子郵件通知嘗試次數。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Scheduler 活動訊號 | AirflowIntegrationRuntimeSchedulerHeartbeat |
排程器活動訊號。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
採用的 Airflow 整合運行時間排程器孤立工作 | AirflowIntegrationRuntimeSchedulerOrphanedTasksAdopted |
排程器採用的孤立工作數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
已清除 Airflow 整合運行時間排程器孤立的工作 | AirflowIntegrationRuntimeSchedulerOrphanedTasksCleared |
排程器清除的孤立工作數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間排程器工作可執行檔 | AirflowIntegrationRuntimeSchedulerTasksExecutable |
針對集區限制、DAG 並行、執行程式狀態和優先順序,準備執行的工作數目(設定為已排入佇列)。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間排程器工作在外部終止 | AirflowIntegrationRuntimeSchedulerTasksKilledExternally |
外部終止的工作數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間排程器工作正在執行 | AirflowIntegrationRuntimeSchedulerTasksRunning |
計數 | 總數 | IntegrationRuntimeName |
PT1M | No | |
Airflow 整合運行時間排程器工作饑餓 | AirflowIntegrationRuntimeSchedulerTasksStarving |
無法排程的工作數目,因為集區中沒有開啟位置。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Started Task Instances | AirflowIntegrationRuntimeStartedTaskInstances |
計數 | 總數 | IntegrationRuntimeName 、 、 DagId TaskId |
PT1M | No | |
使用運算子建立的 Airflow 整合運行時間工作實例 | AirflowIntegrationRuntimeTaskInstanceCreatedUsingOperator |
為特定運算子建立的工作實例數目。 | 計數 | 總數 | IntegrationRuntimeName , Operator |
PT1M | No |
Airflow 整合運行時間工作實例持續時間 | AirflowIntegrationRuntimeTaskInstanceDuration |
毫秒 | 平均 | IntegrationRuntimeName 、 、 DagId TaskID |
PT1M | No | |
Airflow Integration Runtime 工作實例失敗 | AirflowIntegrationRuntimeTaskInstanceFailures |
整體工作實例失敗。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime 工作實例已完成 | AirflowIntegrationRuntimeTaskInstanceFinished |
整體工作實例已完成。 | 計數 | 總數 | IntegrationRuntimeName 、 、 DagId 、 TaskId State |
PT1M | No |
Airflow Integration Runtime 工作實例先前成功 | AirflowIntegrationRuntimeTaskInstancePreviouslySucceeded |
先前成功的工作實例數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime 工作實例成功 | AirflowIntegrationRuntimeTaskInstanceSuccesses |
整體工作實例成功。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
從 DAG 移除的 Airflow 整合運行時間工作 | AirflowIntegrationRuntimeTaskRemovedFromDAG |
針對特定 DAG 移除的工作數目。 (也就是說,工作已不存在於DAG中。 | 計數 | 總數 | IntegrationRuntimeName , DagId |
PT1M | No |
已還原至 DAG 的 Airflow 整合運行時間工作 | AirflowIntegrationRuntimeTaskRestoredToDAG |
針對特定 DAG 還原的工作數目。 (也就是說,先前在資料庫中處於 REMOVED 狀態的工作實例會新增至 DAG 檔案。 | 計數 | 總數 | IntegrationRuntimeName , DagId |
PT1M | No |
Airflow 整合運行時間觸發程序封鎖的主要線程 | AirflowIntegrationRuntimeTriggersBlockedMainThread |
封鎖主線程的觸發程式數目(可能是因為它們未完全異步)。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow 整合運行時間觸發程序失敗 | AirflowIntegrationRuntimeTriggersFailed |
觸發程式在引發事件之前發生錯誤的數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
執行中的 Airflow 整合運行時間觸發程式 | AirflowIntegrationRuntimeTriggersRunning |
目前為觸發程式執行的觸發程式數目(由主機名描述)。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime 觸發程式成功 | AirflowIntegrationRuntimeTriggersSucceeded |
引發至少一個事件的觸發程式數目。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
Airflow Integration Runtime Zombie 工作已終止 | AirflowIntegrationRuntimeZombiesKilled |
殭屍任務被殺了。 | 計數 | 總數 | IntegrationRuntimeName |
PT1M | No |
如需詳細資訊,請參閱 Microsoft.DataFactory/factory 支援的計量。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應