0
0
Apache Airflowdevops~20 mins

DAG performance tracking in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DAG Performance Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Identify DAG run duration from Airflow CLI output
You run the command 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?
A4 minutes
B5 minutes
C1 minute
D6 minutes
Attempts:
2 left
💡 Hint
Subtract the start_date from the end_date to find the duration.
🧠 Conceptual
intermediate
1:00remaining
Understanding Airflow task duration metrics
Which Airflow metric best helps you track how long individual tasks take to complete within a DAG run?
AScheduler heartbeat
BTask duration
CDAG concurrency
DPool slots
Attempts:
2 left
💡 Hint
Think about what measures time spent per task.
🔀 Workflow
advanced
2: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?
A3,1,2,4
B1,3,2,4
C1,2,3,4
D2,1,3,4
Attempts:
2 left
💡 Hint
Start with enabling logging, then configure callbacks, then write functions.
Troubleshoot
advanced
1: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?
AThe Airflow webserver is down
BThe Airflow scheduler is running normally
CThe DAG has completed successfully with recorded start and end times
DThe DAG runs are stuck in queued state and never start
Attempts:
2 left
💡 Hint
If runs never start, duration cannot be calculated.
Best Practice
expert
2: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?
AExport DAG run and task instance metrics regularly to an external monitoring system
BKeep all DAG run data indefinitely in Airflow's metadata database
CDisable DAG run logging to reduce database size
DManually delete DAG run records weekly
Attempts:
2 left
💡 Hint
Think about separating monitoring data from the main Airflow database.