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
with Apache Airflow
Batch-report failed runs and task instances across many DAGs in a time window.
- List the active DAGs so the audit can state the denominator it is reporting against rather than only the failures.
- 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.
- 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.
- 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.