How do I setup Airflow's email configuration to send an email on errors?

前端 未结 2 1262
深忆病人
深忆病人 2021-01-12 12:42

I\'m trying to make an Airflow task intentionally fail and error out by passing in a Bash line (thisshouldnotrun) that doesn\'t work. Airflow is outputting the

2条回答
  •  我在风中等你
    2021-01-12 13:16

    Use below link for creating airflow dag.
    How to trigger daily DAG run at midnight local time instead of midnight UTC time

    Approach 1 : You can setup SMTP locally and make it send email on jobs failure.

    [email]
    email_backend = airflow.utils.email.send_email_smtp
    
    [smtp]
    smtp_host = localhost
    smtp_starttls = False
    smtp_ssl = False
    smtp_port = 25
    smtp_mail_from = noreply@company.com
    

    Approach 2 : You can use Gmail to send email. I have written an article to do this. https://helptechcommunity.wordpress.com/2020/04/04/airflow-email-configuration/

提交回复
热议问题