Airflow Error Tracking using Sentry

By Hiren Rupchandani & Mukesh Kumar

Table of Contents

1. Install Sentry dependency for Airflow

2. Set up Your Account on sentry.io

3. Setup airflow.cfg

4. DAG File

5. Error Tracking using Sentry

6. What’s Next?

Sentry.io is an open-source full-stack error tracking sysem that supports a wide range of servers, browsers, desktops, and mobile languages and frameworks including PHP, Node.js, Python, etc.

The system is used by Dropbox, AirBnB, PayPal, Uber, Reddit, Mozilla, Slack, and Microsoft to monitor thousands of applications. While it is used by a wide range of sectors, it is seeing continued growth in gaming and streaming media, and new demand in industries and services, like finance, commerce, and healthcare.

Airflow can be set up to send errors to Sentry and it is a very simple installation with few steps:

Install sentry dependency for airflow:

pip install ‘apache-airflow[sentry]’

Set Up your Account on sentry.io.

New Project in Sentry
DSN Key partially hidden from our side

Set Up airflow.cfg

Set the sentry_on parameter as True and paste the DSN key for the sentry_dsn parameter:

airflow.cfg file

DAG File

Error Tracking using Sentry

Webserver Error
Sentry Dashboard reporting Error
Sentry Email Error Reporting

Congratulations! Sentry has been set up to monitor errors in airflow.

What’s Next?

Monitoring Airflow Metrics