A Cloud Composer DAG task depends on a third-party service; you must be notified when the task fails. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Attach a notification function to the operator's on_failure_callback parameter..
Why this is the answer
The onfailurecallback parameter in an Airflow operator is designed to execute a specified Python callable whenever the task fails. This directly addresses the requirement for notification upon task failure. onretrycallback is incorrect because it triggers on retries, not necessarily on final failure. A task might retry successfully and never truly fail. Cloud Monitoring alerts on slamissed are not ideal for immediate task failure notification. An SLA miss indicates a task didn't complete within a defined timeframe, which could be due to various reasons, not just failure, and the notification might be delayed. slamisscallback is incorrect because it's triggered when a task misses its Service Level Agreement (SLA), not specifically when it fails. A task can fail without missing an SLA, or miss an SLA without failing if it eventually succeeds but too late.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed