
Answer-first summary for fast verification
Answer: Assign a function with notification logic to the `on_failure_callback` parameter of the operator responsible for the task.
The correct approach is to assign a function with notification logic to the `on_failure_callback` parameter of the operator responsible for the task. This ensures you're notified immediately upon task failure. - **Option A** is incorrect because monitoring `sla_missed` metrics alerts you to SLA breaches, not task failures. - **Option B** is incorrect because `on_retry_callback` triggers during task retries, not failures. - **Option D** is incorrect as `sla_miss_callback` is not a valid parameter in Apache Airflow for failure notifications.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
As a Google Professional Data Engineer orchestrating ETL pipelines with Cloud Composer, you encounter a scenario where a task in your Apache Airflow DAG depends on a third-party service. How can you set up notifications to alert you when this task fails?
A
Configure a Cloud Monitoring alert on the sla_missed metric linked to the task to initiate a notification.
B
Assign a function containing notification logic to the on_retry_callback parameter of the operator handling the task.
C
Assign a function with notification logic to the on_failure_callback parameter of the operator responsible for the task.
D
Assign a function with notification logic to the sla_miss_callback parameter for the operator handling the task.
No comments yet.