ワークフロー オーケストレーション マネージャーの診断ログとメトリック
Note
ワークフロー オーケストレーション マネージャーは Apache Airflow を利用しています。
この記事では、その手順について説明します。
- Azure Data Factory でワークフロー オーケストレーション マネージャーの診断ログとメトリックを有効にする
- ログとメトリックを表示する
- クエリを実行します。
- メトリックを監視し、有向非巡回グラフ (DAG) の失敗でアラート システムを設定する
前提条件
Azure サブスクリプションが必要です。 Azure サブスクリプションをお持ちでない場合は、開始する前に無料の Azure アカウントを作成してください。
ワークフロー オーケストレーション マネージャーの診断ログとメトリックを有効にする
Data Factory リソースを開き、左端のウィンドウで [診断設定] を選択します。 次に [診断設定を追加する] を選択します。
診断設定の名前を入力します。 Airflow ログの次のカテゴリを選択します。
- Airflow task execution logs (Airflow タスク実行ログ)
- Airflow worker logs (Airflow ワーカー ログ)
- Airflow DAG 処理ログ
- Airflow scheduler logs (Airflow スケジューラ ログ)
- Airflow web logs (Airflow Web ログ)
- AllMetrics を選択する場合、監視したりアラートを生成するためにさまざまな Data Factory メトリクスを利用できます。 これらのメトリックには、Data Factory アクティビティとワークフロー オーケストレーション マネージャー統合ランタイムのメトリック (
AirflowIntegrationRuntimeCpuUsage
やAirflowIntegrationRuntimeMemory
など) が含まれます。
[宛先の詳細] で、[Send to Log Analytics workspace](Log Analytics ワークスペースに送信する) チェック ボックスをオンにします。
[保存] を選択します。
ログを表示する
診断設定を追加すると、[診断設定] セクションに一覧表示されます。 ログにアクセスして表示するには、構成した Log Analytics ワークスペースを選択します。
[Log Analytics エクスペリエンスを最大化する] セクションの下にある [ログの表示] を選択します。
Log Analytics ワークスペースに移動し、選択したテーブルが自動的にワークスペースにインポートされたことが確認できます。
スキーマに関するその他の役立つリンク:
- Azure Monitor ログ リファレンス - ADFAirflowSchedulerLogs | Microsoft Learn
- Azure Monitor ログ リファレンス - ADFAirflowTaskLogs | Microsoft Learn
- Azure Monitor ログ リファレンス - ADFAirflowWebLogs | Microsoft Learn
- Azure Monitor ログ リファレンス - ADFAirflowWorkerLogs | Microsoft Learn
- Azure Monitor ログ リファレンス - AirflowDagProcessingLogs | Microsoft Learn
クエリを記述する
ADFAirflowTaskLogs
内のすべてのレコードを返す最も単純なクエリから始めましょう。 テーブル名をダブルクリックして、クエリ ウィンドウにそれを追加できます。 また、ウィンドウにテーブル名を直接入力することもできます。特定のタスク ID に基づいてフィルター処理するなど、検索結果を絞り込むには、次のクエリを使用できます。
ADFAirflowTaskLogs | where DagId == "<your_dag_id>" and TaskId == "<your_task_id>"
同様に、LogManagement
で利用可能なテーブルを使用して、ニーズに応じてカスタム クエリを作成できます。
詳細については、以下を参照してください:
監視メトリック
Data Factory は、Airflow 統合ランタイムの包括的なメトリックを提供するため、Airflow 統合ランタイムのパフォーマンスを効果的に監視し、必要に応じてアラート メカニズムを確立できます。
Data Factory リソースを開きます。
左端のウィンドウの [監視] セクションで、[メトリック] を選択します。
監視する [スコープ]>[メトリック名前空間]>[メトリック] を選択します。
Integration Runtime の CPU パーセンテージとエアフロー統合ランタイムの Dag Bag サイズを視覚化する複数折れ線グラフを確認します。
メトリックが特定の条件を満たした場合にトリガーされるアラート ルールを設定できます。 詳細については、Azure Monitor アラートの概要に関するページを参照してください。
グラフが完了した後、[ダッシュボードに保存] を選択します。それ以外の場合、グラフは消えます。
Airflow メトリック
次の表に、ワークフロー オーケストレーション マネージャーで使用できるメトリックを示します。 テーブルの見出しは次のとおりです。
- メトリック: Azure portal に表示されるメトリックの表示名。
- REST API の名前: REST API で参照されるメトリック名。
- 説明: メトリックの説明。
- ユニット: 測定単位。
- 集計: 既定の集計の種類。 指定できる値は、Average、Minimum、Maximum、Total、Count です。
- ディメンション: メトリックで使用できるディメンション。
- 時間グレイン: メトリックをサンプリングする間隔。 たとえば、PT1M の場合、メトリックが毎分サンプリングされ、PT30M は 30 分ごと、PT1H は 1 時間ごとのようにサンプリングされることを示します。
- DS エクスポート: メトリックが診断設定を使用して Azure Monitor ログにエクスポートできるかどうかを示します。
メトリック | REST API での名前 | 説明 | 出荷単位 | 集計 | Dimensions | 時間グレイン | DS エクスポート |
---|---|---|---|---|---|---|---|
Airflow Integration Runtime Celery Task Timeout Error (Airflow Integration Runtime Celery タスク タイムアウト エラー) | AirflowIntegrationRuntimeCeleryTaskTimeoutError |
Celery Broker にタスクを発行するときに発生した AirflowTaskTimeout エラーの数。 |
Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Collect DB Dags (Airflow Integration Runtime DB Dag の収集) | AirflowIntegrationRuntimeCollectDBDags |
シリアル化されたすべての DAG をデータベースからフェッチするためにかかった時間 (ミリ秒)。 | ミリ秒 | Average | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Cpu Percentage (Airflow Integration Runtime CPU の割合) | AirflowIntegrationRuntimeCpuPercentage |
Airflow 統合ランタイムの CPU 使用率。 | Percent | Average | IntegrationRuntimeName 、ContainerName |
PT1M | いいえ |
Airflow Integration Runtime Memory Usage (Airflow Integration Runtime メモリ使用量) | AirflowIntegrationRuntimeCpuUsage |
Airflow 統合ランタイムによって使用されるミリコア。CPU コアの数千分の 1 単位で使用される CPU リソースを示します。 | ミリコア | Average | IntegrationRuntimeName 、ContainerName |
PT1M | はい |
Airflow Integration Runtime Dag Bag Size (Airflow Integration Runtime Dag バッグ サイズ) | AirflowIntegrationRuntimeDagBagSize |
スケジューラがその構成に基づいてスキャンを実行したときに検出された DAG の数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Dag Callback Exceptions (Airflow Integration Runtime Dag コールバックの例外) | AirflowIntegrationRuntimeDagCallbackExceptions |
DAG コールバックから発生した例外の数。 例外が発生した場合は、DAG コールバックが機能していないことを意味します。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG File Refresh Error (Airflow Integration Runtime DAG ファイルの更新エラー) | AirflowIntegrationRuntimeDAGFileRefreshError |
DAG ファイルの読み込みに失敗した数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Import Errors (Airflow Integration Runtime DAG インポート処理エラー) | AirflowIntegrationRuntimeDAGProcessingImportErrors |
DAG ファイルを解析しようとしたときに発生したエラーの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Last Duration (Airflow Integration Runtime DAG 最終処理期間) | AirflowIntegrationRuntimeDAGProcessingLastDuration |
特定の DAG ファイルの読み込みにかかった時間 (秒)。 | ミリ秒 | Average | IntegrationRuntimeName 、DagFile |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Last Run Seconds Ago (Airflow Integration Runtime DAG 最終処理 (数秒前)) | AirflowIntegrationRuntimeDAGProcessingLastRunSecondsAgo |
<dag_file> が最後に処理されてからの時間 (秒)。 | Seconds | Average | IntegrationRuntimeName 、DagFile |
PT1M | いいえ |
Airflow Integration Runtime DAG ProcessingManager Stalls (Airflow Integration Runtime DAG ProcessingManager 停止) | AirflowIntegrationRuntimeDAGProcessingManagerStalls |
停止した DagFileProcessorManager の数。 |
Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Processes (Airflow Integration Runtime DAG 処理プロセス) | AirflowIntegrationRuntimeDAGProcessingProcesses |
現在実行中の DAG 解析プロセスの相対数。 (たとえば、最後のメトリックが送信されてからプロセスが完了した場合、この差分は負の値になります)。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Processor Timeouts (Airflow Integration Runtime DAG 処理プロセッサのタイムアウト) | AirflowIntegrationRuntimeDAGProcessingProcessorTimeouts |
時間がかかりすぎたために強制終了されたファイル プロセッサの数。 | Seconds | Average | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Processing Total Parse Time (Airflow Integration Runtime DAG 処理の総解析時間) | AirflowIntegrationRuntimeDAGProcessingTotalParseTime |
dag_processing.file_path_queue_size DAG ファイルのスキャンとインポートにかかった時間 (秒)。 |
Seconds | Average | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime DAG Run Dependency Check (Airflow Integration Runtime DAG 実行依存関係チェック) | AirflowIntegrationRuntimeDAGRunDependencyCheck |
DAG の依存関係を確認するのにかかった時間 (ミリ秒)。 | ミリ秒 | Average | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime DAG Run Duration Failed (Airflow Integration Runtime DAG の実行期間に失敗) | AirflowIntegrationRuntimeDAGRunDurationFailed |
DagRun が失敗の状態に達するまでにかかった時間 (秒)。 |
ミリ秒 | Average | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime DAG Run Duration Success (Airflow Integration Runtime DAG の実行期間に成功) | AirflowIntegrationRuntimeDAGRunDurationSuccess |
DagRun が成功の状態に達するまでにかかった時間 (秒)。 |
ミリ秒 | Average | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime DAG Run First Task Scheduling Delay (Airflow Integration Runtime DAG 最初の実行タスク スケジューリングの遅延) | AirflowIntegrationRuntimeDAGRunFirstTaskSchedulingDelay |
最初のタスク start_date から DagRun の予想される開始までに経過した時間 (秒)。 |
ミリ秒 | Average | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime DAG Run Schedule Delay (Airflow Integration Runtime DAG 実行スケジュールの遅延) | AirflowIntegrationRuntimeDAGRunScheduleDelay |
スケジュールされた DagRun の開始日から実際の DagRun の開始日までの遅延時間 (秒)。 |
ミリ秒 | Average | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime Executor Open Slots (Airflow Integration Runtime Executor オープン スロット) | AirflowIntegrationRuntimeExecutorOpenSlots |
Executor で開いているスロットの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Executor Queued Tasks (Airflow Integration Runtime Executor キューに登録されたタスク) | AirflowIntegrationRuntimeExecutorQueuedTasks |
Executor のキューに登録されたタスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Executor Running Tasks (Airflow Integration Runtime Executor 実行中のタスク) | AirflowIntegrationRuntimeExecutorRunningTasks |
Executor で実行されているタスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Job End (Airflow Integration Runtime ジョブの終了) | AirflowIntegrationRuntimeJobEnd |
終了した <job_name> ジョブの数 (SchedulerJob や LocalTaskJob など)。 |
Count | 合計 | IntegrationRuntimeName 、Job |
PT1M | いいえ |
Airflow Integration Runtime Heartbeat Failure (Airflow Integration Runtime ハートビートの失敗) | AirflowIntegrationRuntimeJobHeartbeatFailure |
<job_name> ジョブの失敗したハートビートの数 (SchedulerJob や LocalTaskJob など)。 |
Count | 合計 | IntegrationRuntimeName 、Job |
PT1M | いいえ |
Airflow Integration Runtime Job Start (Airflow Integration Runtime ジョブの開始) | AirflowIntegrationRuntimeJobStart |
開始した <job_name> ジョブの数 (SchedulerJob や LocalTaskJob など)。 |
Count | 合計 | IntegrationRuntimeName 、Job |
PT1M | いいえ |
Airflow Integration Runtime Memory Percentage (Airflow Integration Runtime メモリの割合) | AirflowIntegrationRuntimeMemoryPercentage |
Airflow 統合ランタイム環境で使用されるメモリの割合。 | Percent | Average | IntegrationRuntimeName 、ContainerName |
PT1M | はい |
Airflow Integration Runtime Node Count (Airflow Integration Runtime ノード数) | AirflowIntegrationRuntimeNodeCount |
Count | Average | IntegrationRuntimeName 、ComputeNodeSize |
PT1M | はい | |
Airflow Integration Runtime Operator Failures (Airflow Integration Runtime 演算子の失敗) | AirflowIntegrationRuntimeOperatorFailures |
演算子の失敗の合計数。 | Count | 合計 | IntegrationRuntimeName 、Operator |
PT1M | いいえ |
Airflow Integration Runtime Operator Successes (Airflow Integration Runtime 演算子成功) | AirflowIntegrationRuntimeOperatorSuccesses |
演算子の成功の合計数。 | Count | 合計 | IntegrationRuntimeName 、Operator |
PT1M | いいえ |
Airflow Integration Runtime Pool Open Slots (Airflow Integration Runtime プール オープン スロット) | AirflowIntegrationRuntimePoolOpenSlots |
プール内の開いているスロットの数。 | Count | 合計 | IntegrationRuntimeName 、Pool |
PT1M | いいえ |
Airflow Integration Runtime Pool Queued Slots (Airflow Integration Runtime プール キューに登録されたスロット) | AirflowIntegrationRuntimePoolQueuedSlots |
プール内のキューに登録されたスロットの数。 | Count | 合計 | IntegrationRuntimeName 、Pool |
PT1M | いいえ |
Airflow Integration Runtime Pool Running Slots (Airflow Integration Runtime プール 実行中のスロット) | AirflowIntegrationRuntimePoolRunningSlots |
プール内の実行中のスロットの数。 | Count | 合計 | IntegrationRuntimeName 、Pool |
PT1M | いいえ |
Airflow Integration Runtime Pool Starving Tasks (Airflow Integration Runtime プール枯渇タスク) | AirflowIntegrationRuntimePoolStarvingTasks |
プール内の枯渇しているタスクの数。 | Count | 合計 | IntegrationRuntimeName 、Pool |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Critical Section Busy (Airflow Integration Runtime Scheduler クリティカル セクション ビジー) | AirflowIntegrationRuntimeSchedulerCriticalSectionBusy |
スケジューラ プロセスがクリティカル セクション (Executor にタスクを送信するために必要) のロックを取得しようとして、別のプロセスによってロックされていることがわかった回数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Critical Section Duration (Airflow Integration Runtime Scheduler クリティカル セクション期間) | AirflowIntegrationRuntimeSchedulerCriticalSectionDuration |
スケジューラ ループのクリティカル セクションで費やされた時間 (ミリ秒)。 一度に 1 つのスケジューラだけがこのループに入ることができます。 | ミリ秒 | Average | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Failed SLA Email Attempts (Airflow Integration Runtime Scheduler SLA メール試行の失敗) | AirflowIntegrationRuntimeSchedulerFailedSLAEmailAttempts |
失敗した SLA メール通知の試行に失敗した回数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Heartbeats (Airflow Integration Runtime Scheduler ハートビート) | AirflowIntegrationRuntimeSchedulerHeartbeat |
Scheduler のハートビート。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Orphaned Tasks Adopted (Airflow Integration Runtime Scheduler 孤立タスクの採用) | AirflowIntegrationRuntimeSchedulerOrphanedTasksAdopted |
Scheduler によって採用された孤立タスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Orphaned Tasks Cleared (Airflow Integration Runtime Scheduler 孤立タスクのクリア) | AirflowIntegrationRuntimeSchedulerOrphanedTasksCleared |
Scheduler によってクリアされた孤立タスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Tasks Executable (Airflow Integration Runtime Scheduler タスク実行可能ファイル) | AirflowIntegrationRuntimeSchedulerTasksExecutable |
プールの制限、DAG コンカレンシー、Executor の状態、優先度に関して実行できる (キューに設定されている) タスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Tasks Killed Externally (Airflow Integration Runtime Scheduler 外部で強制終了されたタスク) | AirflowIntegrationRuntimeSchedulerTasksKilledExternally |
外部で強制終了されたタスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Scheduler Tasks Running (Airflow Integration Runtime Scheduler タスク実行中) | AirflowIntegrationRuntimeSchedulerTasksRunning |
Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ | |
Airflow Integration Runtime Scheduler Tasks Starving (Airflow Integration Runtime Scheduler タスク枯渇中) | AirflowIntegrationRuntimeSchedulerTasksStarving |
プール内に開いているスロットがないためにスケジュールできないタスクの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Started Task Instances (Airflow Integration Runtime 開始されたタスク インスタンス) | AirflowIntegrationRuntimeStartedTaskInstances |
Count | 合計 | IntegrationRuntimeName 、DagId 、TaskId |
PT1M | いいえ | |
Airflow Integration Runtime Task Instance Created Using Operator (Airflow Integration Runtime 演算子を使用して作成されたタスク インスタンス) | AirflowIntegrationRuntimeTaskInstanceCreatedUsingOperator |
特定の演算子に対して作成されたタスク インスタンスの数。 | Count | 合計 | IntegrationRuntimeName 、Operator |
PT1M | いいえ |
Airflow Integration Runtime Task Instance Duration (Airflow Integration Runtime タスク インスタンスの期間) | AirflowIntegrationRuntimeTaskInstanceDuration |
ミリ秒 | Average | IntegrationRuntimeName 、DagId 、TaskID |
PT1M | いいえ | |
Airflow Integration Runtime Task Instance Failures (Airflow Integration Runtime タスク インスタンスの失敗) | AirflowIntegrationRuntimeTaskInstanceFailures |
全体的なタスク インスタンスの失敗。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Task Instance Finished (Airflow Integration Runtime タスク インスタンスの完了) | AirflowIntegrationRuntimeTaskInstanceFinished |
タスク インスタンス全体が完了しました。 | Count | 合計 | IntegrationRuntimeName 、DagId 、TaskId , State |
PT1M | いいえ |
Airflow Integration Runtime Task Instance Previously Succeeded (Airflow Integration Runtime 以前に成功したタスク インスタンス) | AirflowIntegrationRuntimeTaskInstancePreviouslySucceeded |
以前に成功したタスク インスタンスの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Task Instance Successes (Airflow Integration Runtime タスク インスタンスの成功) | AirflowIntegrationRuntimeTaskInstanceSuccesses |
タスク インスタンス全体の成功。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Task Removed From DAG (Airflow Integration Runtime DAG から削除されたタスク) | AirflowIntegrationRuntimeTaskRemovedFromDAG |
特定の DAG に対して削除されたタスクの数。 (つまり、タスクは DAG に存在しなくなりました)。 | Count | 合計 | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime Task Restored To DAG (Airflow Integration Runtime DAG に復元されたタスク) | AirflowIntegrationRuntimeTaskRestoredToDAG |
特定の DAG に対して復元されたタスクの数。 (つまり、データベースで以前に REMOVED 状態だったタスク インスタンスが DAG ファイルに追加されます)。 | Count | 合計 | IntegrationRuntimeName 、DagId |
PT1M | いいえ |
Airflow Integration Runtime Triggers Blocked Main Thread (Airflow Integration Runtime メイン スレッドをブロックしたトリガー) | AirflowIntegrationRuntimeTriggersBlockedMainThread |
メイン スレッドをブロックしたトリガーの数 (完全に非同期ではなかった可能性があります)。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Triggers Failed (Airflow Integration Runtime トリガーの失敗) | AirflowIntegrationRuntimeTriggersFailed |
イベントを発生する前にエラーが発生したトリガーの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Triggers Running (Airflow Integration Runtime トリガー実行中) | AirflowIntegrationRuntimeTriggersRunning |
トリガーに対して現在実行されているトリガーの数 (ホスト名で説明)。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Triggers Succeeded (Airflow Integration Runtime トリガー成功) | AirflowIntegrationRuntimeTriggersSucceeded |
少なくとも 1 つのイベントを発生させたトリガーの数。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
Airflow Integration Runtime Zombie Tasks Killed (Airflow Integration Runtime ゾンビ タスクの強制終了) | AirflowIntegrationRuntimeZombiesKilled |
ゾンビ タスクが強制終了されました。 | Count | 合計 | IntegrationRuntimeName |
PT1M | いいえ |
詳細については、「Microsoft.DataFactory/factories でサポートされているメトリック」を参照してください。