Airflow Exporter is an Apache Airflow plugin designed to expose DAG and task-based metrics to a Prometheus-compatible endpoint. The current version, 2.0.0, is built for Airflow 3.0+ and Python 3.9+. It is actively maintained with ongoing development and regular releases.
pip install airflow-exporterNo compatibility data collected yet for this library.
The quickstart involves installing the `airflow-exporter` package into your Airflow environment. Once installed and Airflow components (webserver, scheduler) are restarted, the exporter automatically exposes a Prometheus-compatible metrics endpoint. No direct Python code is needed in your DAGs for the basic functionality.
For Airflow 2.x, pin `airflow-exporter` to `<2.0.0`. For Airflow 3.x+, ensure `apache-airflow` is installed with version `>=3.0` and `airflow-exporter` is `>=2.0.0`.
Ensure `pip install airflow-exporter` is run within the active virtual environment or container image used by Airflow. Restart Airflow scheduler and webserver after installation.
Configure network rules (firewalls, security groups) to allow access to the Airflow webserver's `/admin/metrics/` endpoint from your monitoring system. Verify the exact host and port of your Airflow webserver.
Modify your DAG definition: `dag = DAG(..., params={'labels': {'env': 'production', 'team': 'data'}})`Create a minimal DAG named `canary_dag` in your `dags_folder`. The DAG can contain a simple BashOperator or PythonOperator that always succeeds.
Install Apache Airflow using pip: `pip install apache-airflow`.
Install the Kubernetes package using pip: `pip install kubernetes`.
Downgrade Werkzeug to a compatible version: `pip install werkzeug==0.16.0`.
Update the import statement to: `from airflow.sensors import BaseSensorOperator`.
Install airflow-exporter using pip: `pip install airflow-exporter`.