capabilities.work

Audit DAG Runs Across the Fleet

A 4-step recipe with Apache Airflow. We can help you get access.

Recipe · 4 steps

Audit DAG Runs Across the Fleet

Batch-report failed runs and task instances across many DAGs in a time window.

  1. List the active DAGs so the audit can state the denominator it is reporting against rather than only the failures.
  2. Query DAG runs across every requested DAG in one call. This endpoint is a POST carrying its filters in the body — not because it writes anything, but because the filter lists are too large for a query string.
  3. Pull the failed and upstream_failed task instances across the same DAGs and window, which is what turns a list of failed runs into an actionable report about which tasks are actually breaking.
  4. Read the audit trail for the same period so the report distinguishes pipelines that broke on their own from pipelines a person cleared, paused, or triggered by hand.
What you'll need to have ready
  • dagIds: The DAG ids to audit. The batch endpoints accept many at once, which is the whole reason to use them over the per-DAG list endpoints.
  • startDateGte: The inclusive start of the audit window in ISO 8601 form.
  • startDateLte: The inclusive end of the audit window in ISO 8601 form.
  • states: The DAG run states to report on, e.g. ["failed", "queued"]. Valid values are queued, running, success, and failed.
For your developer

Arazzo workflow apache-airflow:audit-dag-runs, 4 operations: getApiV2Dags → get_dag_runs_batch → get_task_instances_batch → get_event_logs. Specs on APIs.io.