---
title: "Monitor Apache Airflow DAG runs"
url: "https://cronmissed.com/guides/airflow.md"
canonical_url: "https://cronmissed.com/guides/airflow"
last_updated: "2026-10-22"
type: "how-to"
summary: "An Airflow DAG run starts after its data interval ends and, with catchup off, skips old intervals. Ping CronMissed from a final task."
related: ["https://cronmissed.com/guides.md", "https://cronmissed.com/guides/celery-beat.md", "https://cronmissed.com/learn/heartbeat-monitoring.md", "https://cronmissed.com/learn/choosing-grace-time.md", "https://cronmissed.com/snippets/python.md"]
---

# Monitor Apache Airflow DAG runs

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

An Airflow DAG run starts after its data interval ends and, with catchup off, skips old intervals. Ping CronMissed from a final task.

Airflow's own monitoring watches tasks inside runs. It does not watch whether a run began. A DAG run is created after its data interval ends, and with catchup off the scheduler only creates the latest interval, so a stopped scheduler leaves gaps no task failure records.

## How can a scheduled job fail silently on Apache Airflow DAGs?

- A DAG run is usually created after its data interval has ended. A daily DAG for Monday normally starts just after midnight on Tuesday, so its first ping arrives a day later than the logical date suggests.
- The logical date of a run is the start of its data interval, not the time it ran. Alerts that quote the logical date confuse people looking for the clock time.
- By default (scheduler.catchup_by_default is False) intervals that were missed are not created when a DAG is switched on; the scheduler creates a run only for the latest interval.
- If the scheduler or the triggerer is down, no run is created, so no task can fail.

## What are the limits of Apache Airflow DAGs?

| Limit | What the documentation says |
| --- | --- |
| Data interval | Each scheduled run covers a data interval; a run is usually scheduled after the interval ends. |
| Logical date | Marks the start of the data interval, and was called execution_date before Airflow 2.2. |
| Catchup | Off by default; the scheduler creates a run only for the latest interval. |
| Manual triggers | A manual run has its own logical date and does not follow the schedule. |

## How do you add a CronMissed ping to Apache Airflow DAGs?

Add a last task that depends on the work and pings on success, plus a DAG-level failure callback that pings `/fail`. The example uses the Airflow 3 import paths; on Airflow 2 the DAG and BashOperator imports come from `airflow` and `airflow.operators.bash`.

```
import urllib.request
from datetime import datetime

from airflow.providers.standard.operators.bash import BashOperator
from airflow.sdk import DAG

PING = "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"

def report_failure(context):
    request = urllib.request.Request(PING + "/fail", data=str(context.get("exception", ""))[-100000:].encode(), method="POST")
    try:
        urllib.request.urlopen(request, timeout=10).read()
    except OSError:
        pass

with DAG(
    dag_id="nightly_report",
    schedule="15 3 * * *",
    start_date=datetime(2026, 1, 1),
    catchup=False,
    on_failure_callback=report_failure,
) as dag:
    build = BashOperator(task_id="build", bash_command="python /opt/jobs/build_report.py")
    heartbeat = BashOperator(
        task_id="heartbeat",
        bash_command="curl -fsS --max-time 10 --retry 5 -o /dev/null $PING_URL",
        env={"PING_URL": PING},
    )
    build >> heartbeat
```

## Which check settings fit Apache Airflow DAGs?

Create a cron check with the DAG's schedule, but think in clock time: the run starts when the interval ends, which for the schedule above is 03:15. Grace should be longer than the usual queue time between the schedule and the first task starting, often 10 minutes. The check watches what the data interval view hides, whether the scheduler is alive.

## How do you confirm the check works?

1. Trigger the DAG by hand once and confirm the heartbeat task pings.
2. Make the build task fail and confirm the callback sends /fail and the check goes down.
3. Pause the DAG and confirm the check goes late, then down after its grace.

## Questions

### Why is the ping sent from a task and not from a sensor or callback?

A task is visible in the run, retried by Airflow when it fails, and ordered by the graph. A callback is the right place for the failure ping, since the DAG may fail before a final task runs.

### What if the DAG runs hourly with catchup off?

Then each run is the latest interval. A scheduler outage of a few hours produces one run on recovery, not several, so the check sees the gap and then one ping, which is the truthful picture.

## Sources

- [Apache Airflow documentation: DAG runs](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dag-run.html), read 22 October 2026

## Related pages

- [Celery beat](https://cronmissed.com/guides/celery-beat.md)
- [Heartbeat monitoring](https://cronmissed.com/learn/heartbeat-monitoring.md)
- [Choosing a grace time](https://cronmissed.com/learn/choosing-grace-time.md)
- [Python](https://cronmissed.com/snippets/python.md)

## Related

- [Monitor cron jobs on every platform: 24 guides](https://cronmissed.com/guides.md)
- [Monitor Celery beat periodic tasks](https://cronmissed.com/guides/celery-beat.md)
- [Heartbeat monitoring for scheduled jobs](https://cronmissed.com/learn/heartbeat-monitoring.md)
- [How to choose a grace time for a cron check](https://cronmissed.com/learn/choosing-grace-time.md)
- [Ping CronMissed from Python](https://cronmissed.com/snippets/python.md)
