데이터 파이프라인에서 이메일을 통해서, 실패 혹은 retry에 대한 이메일을 받도록 구성할 수 있습니다.
[smtp]
# If you want airflow to send emails on retries, failure, and you want to use
# the airflow.utils.email.send_email_smtp function, you have to configure an
# smtp server here
smtp_host = smtp.gmail.com
smtp_starttls = True
smtp_ssl = False
# Example: smtp_user = airflow
smtp_user = {구글 이메일 주소}
# Example: smtp_password = airflow
smtp_password = {발급 받은 앱 비밀번호에서, 띄어쓰기 제외한 문자열}
smtp_port = 587
smtp_mail_from = {구글 이메일 주소}
smtp_timeout = 30
smtp_retry_limit = 5
yop mail을 통해서 테스트해봅니다.
from airflow.operators.email import EmailOperator
send_email_notification = EmailOperator(
task_id="send_email_notification",
to="airflow_course@yopmail.com",
subject="forex_data_pipeline",
html_content="<h3>forex_data_pipeline</h3>",
)