0
0
Apache Airflowdevops~20 mins

SLA misses and notifications in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SLA Notification Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding SLA Misses in Airflow

What happens in Airflow when a task misses its SLA?

AAirflow immediately stops the entire DAG run and marks it as failed.
BAirflow triggers an SLA miss callback and logs the event but does not stop the DAG run.
CAirflow retries the task automatically regardless of retry settings.
DAirflow ignores the SLA miss and continues without any notification.
Attempts:
2 left
💡 Hint

Think about how Airflow handles SLA misses without interrupting the workflow.

💻 Command Output
intermediate
1:30remaining
SLA Miss Notification Email Content

Given the following SLA miss callback function in Airflow, what will be the subject line of the notification email sent?

def sla_miss_callback(dag, task_list, blocking_task_list, slas, blocking_tis):
    return f"SLA Miss Alert: DAG {dag.dag_id} missed SLA for tasks {', '.join(task_list)}"

# Assume dag.dag_id = 'data_pipeline', task_list = ['task1', 'task2']
ASLA Miss Alert: DAG data_pipeline missed SLA for tasks task1, task2
BAlert: SLA missed for data_pipeline tasks task1 and task2
CSLA Missed: data_pipeline task1 task2
DNotification: SLA miss detected in DAG data_pipeline
Attempts:
2 left
💡 Hint

Look carefully at the string formatting in the callback function.

Configuration
advanced
2:00remaining
Configuring SLA Miss Email Notifications

Which Airflow configuration setting must be enabled to send email notifications on SLA misses?

Asla_miss_callback must be set and email backend configured
Bsend_sla_notifications = True in airflow.cfg
Cemail_on_sla_miss = True in DAG definition
Denable_sla_miss_email = True in airflow.cfg
Attempts:
2 left
💡 Hint

Think about what is required beyond just a config flag to send emails.

Troubleshoot
advanced
2:00remaining
Troubleshooting Missing SLA Notifications

You configured SLA miss notifications in Airflow, but no emails are received when SLAs are missed. What is the most likely cause?

AThe SMTP server settings in airflow.cfg are incorrect or missing.
BThe DAG has no SLA defined on any tasks.
CThe SLA miss callback function is not defined or not assigned in the DAG.
DAll of the above.
Attempts:
2 left
💡 Hint

Consider all parts needed for SLA notifications to work.

🔀 Workflow
expert
2:30remaining
SLA Miss Handling Workflow in Airflow

Order the steps Airflow takes when a task misses its SLA.

A1,3,2,4
B1,2,4,3
C1,2,3,4
D2,1,3,4
Attempts:
2 left
💡 Hint

Think about detection, callback, notification, and workflow continuation order.