Back to Skywalking

Support Apache Airflow Monitoring

docs/en/swip/SWIP-7.md

11.0.06.2 KB
Original Source

Support Apache Airflow Monitoring

Motivation

Apache Airflow is an open-source workflow management platform primarily used for scheduling and monitoring workflows. It can be used to handle complex data pipelines and has been widely applied in the fields of data engineering and data science. Airflow allows users to write workflows called DAGs (Directed Acyclic Graphs). Each DAG contains a series of tasks that can be executed in a specific sequence and dependency relationship. Due to its support for multitasking in complex scenarios, monitoring the health and operational status of Airflow is crucial. Through these metrics, it is possible to help analyze task health status, formulate optimization plans, and design risk prevention strategies.

Architecture Graph

mermaid
graph LR;
  AirflowOTEL("Airflow OTEL") --> OpenTelemetryCollector("OpenTelemetry Collector") --> SkyWalkingOTELReceiver("SkyWalking OTEL Receiver") --> SkyWalkingMALEngine("SkyWalking MAL Engine") --> HorizonUI("Horizon UI")

Proposed Changes

  1. Airflow exports metrics via native OpenTelemetry (otel_on / OTEL_EXPORTER_OTLP_*).
  2. OpenTelemetry Collector receives OTLP metrics from Airflow and forwards them to SkyWalking OTel Receiver via the OpenTelemetry exporter.
  3. The SkyWalking OAP Server parses expressions with MAL to filter, calculate, aggregate, and store the results.
  4. Metrics are displayed via Horizon UI under the Workflow Scheduler menu group and can be customized on dashboards.

SkyWalking models an Airflow deployment as Layer: AIRFLOW:

  • Service — one logical cluster (airflow::{cluster}), keyed by resource attribute cluster.
  • Instance — scheduler or triggerer host (host.name resource attribute).

Horizon labels this entity Components rather than Instance so operators are not led to confuse it with Airflow Task Instance (a single task execution within one DAG run). See Airflow monitoring setup for the full naming rationale.

Airflow Service Supported Metrics

Monitoring PanelUnitMetric NameDescription
Tasks Executablecountmeter_airflow_scheduler_tasks_executableTasks ready for execution
Running Taskscountmeter_airflow_executor_running_tasksTasks currently running on executor
Queued Taskscountmeter_airflow_executor_queued_tasksQueued tasks on executor
Scheduled Slotscountmeter_airflow_pool_scheduled_slotsScheduled but not yet running slots in pool (aggregated across pools via aggregate_labels in the UI KPI card)
Executor Open Slotscountmeter_airflow_executor_open_slotsOpen executor slots
DAG File Queue Sizecountmeter_airflow_dag_file_queue_sizeDAG files pending scan
DAG Import Errorscountmeter_airflow_dag_import_errorsDAG files that failed to parse
DAG Bag Sizecountmeter_airflow_dagbag_sizeDAGs found in the last scheduler scan
DAG Total Parse Timesecondsmeter_airflow_dag_total_parse_timeTime to scan and import queued DAG files
DAG File Refresh Errorscount/minmeter_airflow_dag_file_refresh_errorDAG file load failures per minute
Asset Updatescount/minmeter_airflow_asset_updatesUpdated assets per minute

Airflow Instance Supported Metrics

Monitoring PanelUnitMetric NameDescription
Pool Open / Deferred / Running Slotscountmeter_airflow_instance_pool_open_slots, meter_airflow_instance_pool_deferred_slots, meter_airflow_instance_pool_running_slotsPool capacity on the scheduler
Running Tasks / Scheduled Slotscountmeter_airflow_instance_executor_running_tasks, meter_airflow_instance_pool_scheduled_slotsExecutor queue depth and pool slots waiting to run
Scheduler Heartbeatcount/minmeter_airflow_instance_scheduler_heartbeatScheduler heartbeats per minute
Executor Open / Queued Slotscountmeter_airflow_instance_executor_open_slots, meter_airflow_instance_executor_queued_tasksExecutor capacity and queue depth on the scheduler
Asset Updatescount/minmeter_airflow_instance_asset_updatesAsset updates on this host
Asset Triggered DagRunscount/minmeter_airflow_instance_asset_triggered_dagrunsDagRuns triggered by assets
Triggerer Heartbeatcount/minmeter_airflow_instance_triggerer_heartbeatTriggerer heartbeats per minute
Triggers Running / Capacity Leftcountmeter_airflow_instance_triggers_running, meter_airflow_instance_triggerer_capacity_leftLive deferrable trigger load on the triggerer
Triggers Blocked / Failed / Succeededcount/minmeter_airflow_instance_triggers_blocked_main_thread, meter_airflow_instance_triggers_failed, meter_airflow_instance_triggers_succeededDeferred trigger outcomes on the triggerer

Service-level panels aggregate cluster-wide samples. Instance-level panels are scoped per host.name (shown as Components in the UI). Do not sum instance-scoped samples into service dashboards when each component exports the same instrument independently.

Scheduler and triggerer components use Airflow core OpenTelemetry export only.

Airflow 3.x only. Asset metrics use OTel instruments airflow.asset.* (Airflow 2.x airflow.dataset.* is not supported).

Bundled Horizon UI dashboards chart the metrics above one-to-one (27 MAL metrics: 11 Service + 16 Instance). Tasks Executable is Service-only (meter_airflow_scheduler_tasks_executable). The Service dashboard has 11 panels. The Components template defines nine widgets; scheduler hosts show six, triggerer hosts show three (see setup doc).

Imported Dependencies libs and their licenses.

No new dependency.

Compatibility

No breaking changes.

General usage docs

See Airflow monitoring setup and e2e coverage matrix.