0
0
Apache Airflowdevops~20 mins

Airflow metrics with Prometheus - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Airflow Metrics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Airflow Metrics Export

Which Airflow component is responsible for exposing metrics to Prometheus?

AThe Airflow Scheduler exposes metrics via a built-in Prometheus exporter.
BThe Airflow Worker pushes metrics directly to Prometheus using a push gateway.
CThe Airflow Webserver exposes metrics through a Prometheus endpoint.
DThe Airflow Metadata Database exports metrics to Prometheus automatically.
Attempts:
2 left
💡 Hint

Think about which Airflow service handles HTTP requests and UI.

💻 Command Output
intermediate
2:00remaining
Prometheus Metrics Endpoint Output

What is the expected output when you curl the Airflow Webserver's Prometheus metrics endpoint /metrics?

Apache Airflow
curl http://localhost:8080/metrics
A
# HELP airflow_scheduler_heartbeat_seconds Time since last scheduler heartbeat
# TYPE airflow_scheduler_heartbeat_seconds gauge
airflow_scheduler_heartbeat_seconds 12.345
B
# HELP airflow_task_duration_seconds Duration of task execution
# TYPE airflow_task_duration_seconds histogram
airflow_task_duration_seconds_bucket{le="5"} 10
airflow_task_duration_seconds_bucket{le="10"} 15
C
HTTP 404 Not Found
D
Error: Connection refused
Attempts:
2 left
💡 Hint

The metrics endpoint provides Prometheus formatted metrics about Airflow components.

Configuration
advanced
2:00remaining
Configuring Airflow to Enable Prometheus Metrics

Which configuration change is required in airflow.cfg to enable Prometheus metrics on the Airflow Webserver?

A
[metrics]
prometheus = True
port = 9090
B
[metrics]
enabled = True
exporter = prometheus
C
[webserver]
metrics_exporter = prometheus
metrics_port = 8080
D
[metrics]
enabled = True
backend = prometheus
Attempts:
2 left
💡 Hint

Look for the correct section and keys related to metrics export.

Troubleshoot
advanced
2:00remaining
Troubleshooting Missing Metrics in Prometheus

You configured Airflow to expose Prometheus metrics, but Prometheus shows no data for Airflow targets. What is the most likely cause?

AThe Airflow Webserver is not running or not reachable on the metrics port.
BPrometheus is not configured to scrape the Airflow Metadata Database.
CThe Airflow Scheduler is not pushing metrics to Prometheus push gateway.
DThe Airflow Workers are blocking the metrics endpoint with firewall rules.
Attempts:
2 left
💡 Hint

Check network connectivity and service status first.

🔀 Workflow
expert
3:00remaining
Setting Up Full Airflow Metrics Monitoring with Prometheus and Grafana

Order the steps correctly to set up Airflow metrics monitoring with Prometheus and Grafana.

A1,3,2,4
B2,1,3,4
C3,2,1,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about enabling metrics first, then scraping, then visualization setup.