Monte Carlo's Apache Airflow Provider
Maintained. Last release 7 months ago. Weaker on release cadence.
pip install airflow-mcdairflow-mcd
Monte Carlo's Airflow provider.
Installation
Requires Python 3.7 or greater and is compatible with Airflow 1.10.14 or greater.
You can install and update using pip. For instance:
pip install -U airflow-mcd
This package can be added like any other python dependency to Airflow (e.g. via requirements.txt).
apache-airflow>=1.10.14 is required for this package to work so it also needs to be installed.
pip install -U apache-airflow>=1.10.14
pip install -U airflow-mcd
Basic usage
Callbacks
Sends a webhook back to Monte Carlo upon an event in Airflow. [Detailed examples and documentation here] (https://docs.getmontecarlo.com/docs/airflow-incidents-dags-and-tasks). Callbacks are at the DAG or Task level.
To import: from airflow_mcd.callbacks import mcd_callbacks
Broad Callbacks
if you don't have existing callbacks, these provide all-in-one callbacks:
dag_callbacks
task_callbacks
examples:
dag = DAG(
'dag_name',~~~~
**mcd_callbacks.dag_callbacks,
)
task = BashOperator(
task_id='task_name',
bash_command='command',
dag=dag,
**mcd_callbacks.task_callbacks,
)
Explicit Callbacks
| Callback Type | Description | DAG | Task |
|---|---|---|---|
on_success_callback | Invoked when the DAG/task succeeds | mcd_dag_success_callback | mcd_task_success_callback |
on_failure_callback | Invoked when the DAG/task fails | mcd_dag_failure_callback | mcd_task_failure_callback |
sla_miss_callback | Invoked when task(s) in a DAG misses its defined SLA | mcd_sla_miss_callback | N/A |