Monitor Apache Airflow DAG runs

On this page

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?

LimitWhat the documentation says
Data intervalEach scheduled run covers a data interval; a run is usually scheduled after the interval ends.
Logical dateMarks the start of the data interval, and was called execution_date before Airflow 2.2.
CatchupOff by default; the scheduler creates a run only for the latest interval.
Manual triggersA 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.

nightly_report.py
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.

Sources

Questions and answers

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.
Know when this job stops

Create a check, add the ping to the job, and CronMissed alerts you the first time a run is late or reports a failure.

Start monitoring