0
0
Apache Airflowdevops~20 mins

Log inspection and troubleshooting in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Airflow Log Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Identify the output of the Airflow CLI log command
You run the command airflow tasks logs example_dag example_task 2024-06-01. What will this command output?
AThe status summary of all tasks in <code>example_dag</code> for June 1, 2024.
BA list of all DAGs available in Airflow.
CAn error message saying the task does not exist.
DThe logs of the task <code>example_task</code> from the DAG <code>example_dag</code> for the execution date June 1, 2024.
Attempts:
2 left
💡 Hint
The command airflow tasks logs shows logs for a specific task instance.
Troubleshoot
intermediate
2:00remaining
Troubleshoot missing logs in Airflow UI
You notice that the Airflow web UI shows No logs found for a task that ran successfully. What is the most likely cause?
AThe task logs are stored remotely but the Airflow UI is not configured to access the remote storage.
BThe task never ran, so no logs exist.
CThe Airflow scheduler is down, so logs cannot be displayed.
DThe DAG file has syntax errors preventing log generation.
Attempts:
2 left
💡 Hint
Check where Airflow stores logs and if the UI can access that location.
Configuration
advanced
3:00remaining
Configure Airflow to store logs remotely on Amazon S3
Which configuration snippet correctly sets Airflow to store logs on Amazon S3?
A
[core]
remote_logging = True
remote_log_conn_id = MyS3Conn
remote_base_log_folder = s3://my-airflow-logs
B
[logging]
remote_logging = False
remote_log_conn_id = MyS3Conn
remote_base_log_folder = s3://my-airflow-logs
C
[logging]
remote_logging = True
remote_log_conn_id = MyS3Conn
remote_base_log_folder = s3://my-airflow-logs
D
[logging]
remote_logging = True
remote_log_conn_id = MyLocalConn
remote_base_log_folder = /var/log/airflow
Attempts:
2 left
💡 Hint
Remote logging settings belong under the [logging] section.
🔀 Workflow
advanced
2:30remaining
Steps to troubleshoot a failing Airflow task using logs
What is the correct order of steps to troubleshoot a failing Airflow task using logs?
A2,1,3,4
B1,2,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Start by looking at logs, then find the error, then fix it.
Best Practice
expert
3:00remaining
Best practice for managing Airflow logs in a production environment
Which option is the best practice for managing Airflow logs in a production environment with many DAGs and tasks?
AUse remote logging to a centralized storage like S3 or GCS and configure log rotation.
BDisable logging to save disk space and rely on task status only.
CStore logs locally on the Airflow worker nodes to reduce latency.
DManually copy logs from workers to a shared folder daily.
Attempts:
2 left
💡 Hint
Think about scalability, reliability, and ease of access.