0
0
Apache Airflowdevops~10 mins

Airflow metrics with Prometheus - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable Prometheus metrics in Airflow's configuration.

Apache Airflow
[metrics]
enabled = [1]
Drag options to blanks, or click blank then click option'
AYes
BFalse
CNo
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Yes' or 'No' instead of boolean values.
Leaving the value as 'False' which disables metrics.
2fill in blank
medium

Complete the code to set the Prometheus metrics port in Airflow's configuration.

Apache Airflow
[metrics]
port = [1]
Drag options to blanks, or click blank then click option'
A8080
B9090
C5000
D1234
Attempts:
3 left
💡 Hint
Common Mistakes
Using ports like 8080 or 5000 which are not default for Prometheus.
Choosing a random port number.
3fill in blank
hard

Fix the error in the command to start the Prometheus metrics server for Airflow.

Apache Airflow
airflow metrics [1]
Drag options to blanks, or click blank then click option'
Aserve
Blaunch
Cstart
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'launch' which are not valid Airflow CLI commands.
Typing 'execute' instead of 'serve'.
4fill in blank
hard

Fill both blanks to create a Prometheus scrape configuration for Airflow metrics.

Apache Airflow
- job_name: 'airflow'
  static_configs:
    - targets: ['[1]:[2]']
Drag options to blanks, or click blank then click option'
Alocalhost
B9090
C8080
Dairflow-metrics
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong port like 8080.
Using a hostname that does not resolve to the metrics server.
5fill in blank
hard

Fill all three blanks to define a Prometheus alert rule for Airflow task failures.

Apache Airflow
groups:
- name: airflow_alerts
  rules:
  - alert: AirflowTaskFailure
    expr: airflow_task_failed_total[1] > [2]
    for: [3]m
Drag options to blanks, or click blank then click option'
A{job="airflow"}
B5
C10
D{job="scheduler"}
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong job label like 'scheduler'.
Setting too low or too high thresholds without reason.