liveBook · Manning

Monitoring

As explained in Data Pipelines with Apache Airflow, Second Edition

Logging is the recording of operational events and messages produced during software execution.

Monitoring tracks Airflow’s operational behavior so production problems become visible. Logs provide textual evidence from the API server, scheduler, and individual task instances; metrics add numerical measurements of system status. section 15.6 section 15.7

Use the four basic signals across tasks, DAGs, and Airflow components:

  • Latency: measure response duration, such as web-server response time or the delay from queued to running. section 15.7.5
  • Load: measure demand, such as tasks processed or available pool slots over time. section 15.7.5
  • Errors: count failures such as zombie tasks, non-200 web responses, and timed-out tasks. section 15.7.5
  • Saturation: compare resource or task usage with system capacity, including CPU load and running tasks. section 15.7.5

By default, Airflow writes logs under $AIRFLOW_HOME/logs. API-server access and error output normally goes to stdout or stderr, while scheduler output is written to files, including per-DAG processing logs and an aggregated manager log. The scheduler manager log rotates automatically at 100 MB. section 15.6 section 15.6.1 section 15.6.2

Preserving API-server output

Start the API server with a Gunicorn logging configuration file: airflow api-server --log_config [filename]. Configure accesslog and errorlog paths in that file to preserve both request activity and errors after shutdown. section 15.6.1

Figure 15.9 An example visualization of the number of running tasks. Here, parallelism had the default value 32, to which the number of tasks sometimes spikes.
An example visualization of the number of running tasks

Use the running-task visualization to inspect workload spikes and compare activity with Airflow’s parallelism limit. section 15.7

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains log categories, storage, scheduler files, four monitoring signals, and exporters, while deferring tracing.
Examples
Uses API access records, scheduler processing files, task logs, running-task dashboards, and Prometheus exporters.
What it assumes
Assumes basic Airflow deployment knowledge and introduces monitoring through concrete logs, metrics, dashboards, and exporters.
What you can do after
Diagnose Airflow operation with logs and metrics, configure API-server log files, and track latency, load, errors, and saturation.
How it connects
Connects logs with metrics and traces, and relates monitoring to Airflow tasks, DAGs, schedulers, web servers, and exporters.

Also explained in

Compare how 40 books explain monitoring →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.