diff --git a/dags/fxci_metric_export.py b/dags/fxci_metric_export.py index 061bb0102..63b534bd3 100644 --- a/dags/fxci_metric_export.py +++ b/dags/fxci_metric_export.py @@ -8,10 +8,18 @@ from airflow import DAG from airflow.providers.cncf.kubernetes.secret import Secret +from airflow.providers.slack.notifications.slack import send_slack_notification from operators.gcp_container_operator import GKEPodOperator from utils.tags import Tag +SLACK_FAILURE_NOTIFICATION = send_slack_notification( + text="DAG {{ dag.dag_id }} failed: <{{ task_instance.log_url }}|view log>", + username="airflow-bot", + slack_conn_id="slack_airflow_bot", + channel="#fxci-etl", +) + default_args = { "owner": "ahalberstadt@mozilla.com", "depends_on_past": False, @@ -20,6 +28,7 @@ "email_on_retry": False, "retries": 1, "retry_delay": timedelta(minutes=30), + "on_failure_callback": SLACK_FAILURE_NOTIFICATION, } tags = [Tag.ImpactTier.tier_3] @@ -68,7 +77,7 @@ gcp_conn_id="google_cloud_airflow_gke", dag=dag, email=[ - "ahalberstadt@mozilla.com", + "release+fxci-etl@mozilla.com", "telemetry-alerts@mozilla.com", ], ) diff --git a/dags/fxci_pulse_export.py b/dags/fxci_pulse_export.py index 8b6ed3e9a..005f787e5 100644 --- a/dags/fxci_pulse_export.py +++ b/dags/fxci_pulse_export.py @@ -11,10 +11,18 @@ from airflow import DAG from airflow.providers.cncf.kubernetes.secret import Secret +from airflow.providers.slack.notifications.slack import send_slack_notification from operators.gcp_container_operator import GKEPodOperator from utils.tags import Tag +SLACK_FAILURE_NOTIFICATION = send_slack_notification( + text="DAG {{ dag.dag_id }} failed: <{{ task_instance.log_url }}|view log>", + username="airflow-bot", + slack_conn_id="slack_airflow_bot", + channel="#fxci-etl", +) + default_args = { "owner": "ahalberstadt@mozilla.com", "depends_on_past": False, @@ -23,6 +31,7 @@ "email_on_retry": False, "retries": 1, "retry_delay": timedelta(minutes=30), + "on_failure_callback": SLACK_FAILURE_NOTIFICATION, } tags = [Tag.ImpactTier.tier_3] @@ -71,7 +80,7 @@ gcp_conn_id="google_cloud_airflow_gke", dag=dag, email=[ - "ahalberstadt@mozilla.com", + "release+fxci-etl@mozilla.com", "telemetry-alerts@mozilla.com", ], )