Reputation: 1220
I have the following default args for a airflow dag:
DEFAULT_ARGS = {
'owner': 'me',
'depends_on_past': False,
'email': ['[email protected]'],
'email_on_failure': True,
'retries': 4,
'retry_delay': timedelta(seconds=5)
}
Each time when a specific job attempt fails, I got an email alert. However, is it possible to ask airflow to only send alerts when all the retries/attempts fail?
Upvotes: 2
Views: 5694
Reputation: 166
Disable email_on_retry option in default_Args.
DEFAULT_ARGS = {
'owner': 'me',
'depends_on_past': False,
'email': ['[email protected]'],
'email_on_failure': True,
'retries': 4,
'email_on_retry': False,
'retry_delay': timedelta(seconds=5)
}
Since all these email options are available in base operator as well in case you want to apply different option on each job eg enable email alert on retry for some jobs.
Interesting article on configuring mail in airflow https://www.astronomer.io/guides/error-notifications-in-airflow
Upvotes: 7