From the course: Data Engineering Pipeline Management with Apache Airflow
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Configuring DAG failed action - Apache Airflow Tutorial
From the course: Data Engineering Pipeline Management with Apache Airflow
Configuring DAG failed action
- [Instructor] Notice that you can configure an SLA and the SLA missed emails are sent automatically. You can also configure email alerts in case of task failure and that's what we'll see here in this demo. We'll use the email operator that Airflow provides to send a custom email when a particular task fails. You can see the import I have on line 15 for the email operator. That's what we'll be using to send an email. Here are the default arguments that are configured for our DAG. Notice the SLA attribute on line 29 set to a time delta of five seconds, so the DAG has to be completed within five seconds. I've also set up a retry delay of five minutes, so the DAG will be retried only every five minutes and I've set email to be cloud.user@loonycorn.com. That's the email address that will receive messages. Now, email_on_failure I've set to False. That's because I do not want the default email on task failure in a DAG. I'm…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.