Challenge - 5 Problems
DAG Performance Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Identify DAG run duration from Airflow CLI output
You run the command
What is the duration of this DAG run?
airflow dags list-runs -d example_dag and get the following output snippet:run_id | state | execution_date | start_date | end_date --------------- | ------- | --------------------| ------------------- | ------------------- manual__2024-06-01T00:00:00+00:00 | success | 2024-06-01 00:00:00 | 2024-06-01 00:01:00 | 2024-06-01 00:05:00
What is the duration of this DAG run?
Attempts:
2 left
💡 Hint
Subtract the start_date from the end_date to find the duration.
✗ Incorrect
The DAG started at 00:01 and ended at 00:05, so the duration is 4 minutes.
🧠 Conceptual
intermediate1:00remaining
Understanding Airflow task duration metrics
Which Airflow metric best helps you track how long individual tasks take to complete within a DAG run?
Attempts:
2 left
💡 Hint
Think about what measures time spent per task.
✗ Incorrect
Task duration measures the time taken by each task to run, which helps track performance.
🔀 Workflow
advanced2:00remaining
Steps to enable DAG run duration logging in Airflow
You want to track DAG run durations by logging start and end times automatically. Which sequence of steps is correct?
Attempts:
2 left
💡 Hint
Start with enabling logging, then configure callbacks, then write functions.
✗ Incorrect
First enable logging, then configure callbacks in the DAG, write the callback functions, and finally deploy and monitor.
❓ Troubleshoot
advanced1:30remaining
Diagnosing missing DAG run duration data in Airflow UI
You notice that DAG run durations are not showing in the Airflow UI. Which of the following is the most likely cause?
Attempts:
2 left
💡 Hint
If runs never start, duration cannot be calculated.
✗ Incorrect
If DAG runs are stuck queued, they have no start or end time, so duration is missing.
✅ Best Practice
expert2:00remaining
Best practice for long-term DAG performance tracking in Airflow
What is the best practice to maintain historical DAG performance data over months without impacting Airflow database performance?
Attempts:
2 left
💡 Hint
Think about separating monitoring data from the main Airflow database.
✗ Incorrect
Exporting metrics to external systems like Prometheus or ELK allows long-term tracking without slowing Airflow.