Lightrun for Apache Airflow¶
To run Lightrun for Python with Apache Airflow you must select one or more tasks in the DAG that you want to debug.
- With the same Python interpreter used by Airflow, install the Python agent, by running
python -m pip install lightrun.
- Within your Airflow task definition, add the
@lightrun_airflow_taskdecorator; for example:
@lightrun_airflow_task(company_key="1111-2222-3333") def foo(): # Do something pass
To import the decorator, add following line:
from lightrun.decorators import lightrun_airflow_task
The following table lists the available parameters for the
| ||The Lightrun registered company to which the user belongs. Must be supplied with either this parameter or the |
| ||The company's secret API key. Must be supplied with either this parameter or the |
| ||[Optional] The filesystem path of a configuration for the lightrun agent|
| ||The time, in milliseconds, to sleep after initializing the agent. If this parameter is set to a low value, the agent might have insufficient time to initialize before the task begins execution, which will result in missing breakpoints inserted in lines that are executed before the agent finishes initialization.|
Airflow with Lightrun's Free Tier
A separate agent is required for each Airflow task that you want to apply simultaneously with other tasks. Contact us if you need more agents.
Last update: May 29, 2023