Skip to content

Add INFO-level logging to asset scheduling path#63958

Merged
kaxil merged 2 commits intoapache:mainfrom
astronomer:add-dataset-scheduling-logging
Mar 21, 2026
Merged

Add INFO-level logging to asset scheduling path#63958
kaxil merged 2 commits intoapache:mainfrom
astronomer:add-dataset-scheduling-logging

Conversation

@kaxil
Copy link
Copy Markdown
Member

@kaxil kaxil commented Mar 20, 2026

The scheduler's asset (dataset) condition evaluation path had zero INFO-level logging, making it impossible to debug why asset-triggered DagRuns were created or skipped. This was a significant gap discovered during a debugging session where the root cause took hours to trace because the scheduler was a complete black box for asset scheduling.

Add log lines for:

  • ADRQ records loaded per DAG (count and DAG IDs)
  • Asset condition evaluation result (met/not met per DAG)
  • DAGs deferred due to max_active_runs
  • Asset-triggered DagRun creation (DAG ID, triggered_date, queued count)
  • Consumed asset events count per DagRun
  • ADRQ rows deleted after DagRun creation

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@kaxil kaxil requested review from Lee-W and uranusjr March 20, 2026 00:23
@kaxil kaxil requested review from XD-DENG and ashb as code owners March 20, 2026 00:23
@boring-cyborg boring-cyborg Bot added the area:Scheduler including HA (high availability) scheduler label Mar 20, 2026
@kaxil kaxil modified the milestones: Airflow 3.2.0, Airflow 3.1.9 Mar 20, 2026
Copy link
Copy Markdown
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a new nits. overall looks good

Comment thread airflow-core/src/airflow/models/dag.py Outdated
Comment thread airflow-core/src/airflow/models/dag.py Outdated
Comment thread airflow-core/src/airflow/jobs/scheduler_job_runner.py
kaxil added 2 commits March 21, 2026 01:28
The scheduler's asset (dataset) condition evaluation path had zero
INFO-level logging, making it impossible to debug why asset-triggered
DagRuns were created or skipped. This was a significant gap discovered
during a P1 customer incident where the root cause took hours to trace
because the scheduler was a complete black box for asset scheduling.

Add log lines for:
- ADRQ records loaded per DAG (count and DAG IDs)
- Asset condition evaluation result (met/not met per DAG)
- DAGs deferred due to max_active_runs
- Asset-triggered DagRun creation (DAG ID, triggered_date, queued count)
- Consumed asset events count per DagRun
- ADRQ rows deleted after DagRun creation
- Change "DAGs" to "Dags" in asset-triggered log messages (dag.py)
- Fix mypy attr-defined error by casting session.execute() result to
  CursorResult, matching the existing pattern in delete_dag.py
@kaxil kaxil force-pushed the add-dataset-scheduling-logging branch from d5581f3 to 2d3f86b Compare March 21, 2026 01:28
@kaxil kaxil merged commit 5ddd284 into apache:main Mar 21, 2026
80 checks passed
@kaxil kaxil deleted the add-dataset-scheduling-logging branch March 21, 2026 02:49
fat-catTW pushed a commit to fat-catTW/airflow that referenced this pull request Mar 22, 2026
The scheduler's asset (dataset) condition evaluation path had zero
INFO-level logging, making it impossible to debug why asset-triggered
DagRuns were created or skipped. This was a significant gap discovered
during a P1 customer incident where the root cause took hours to trace
because the scheduler was a complete black box for asset scheduling.

Add log lines for:
- ADRQ records loaded per DAG (count and DAG IDs)
- Asset condition evaluation result (met/not met per DAG)
- DAGs deferred due to max_active_runs
- Asset-triggered DagRun creation (DAG ID, triggered_date, queued count)
- Consumed asset events count per DagRun
- ADRQ rows deleted after DagRun creation

* Address review feedback: fix casing in log messages and mypy error

- Change "DAGs" to "Dags" in asset-triggered log messages (dag.py)
- Fix mypy attr-defined error by casting session.execute() result to
  CursorResult, matching the existing pattern in delete_dag.py
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
The scheduler's asset (dataset) condition evaluation path had zero
INFO-level logging, making it impossible to debug why asset-triggered
DagRuns were created or skipped. This was a significant gap discovered
during a P1 customer incident where the root cause took hours to trace
because the scheduler was a complete black box for asset scheduling.

Add log lines for:
- ADRQ records loaded per DAG (count and DAG IDs)
- Asset condition evaluation result (met/not met per DAG)
- DAGs deferred due to max_active_runs
- Asset-triggered DagRun creation (DAG ID, triggered_date, queued count)
- Consumed asset events count per DagRun
- ADRQ rows deleted after DagRun creation

* Address review feedback: fix casing in log messages and mypy error

- Change "DAGs" to "Dags" in asset-triggered log messages (dag.py)
- Fix mypy attr-defined error by casting session.execute() result to
  CursorResult, matching the existing pattern in delete_dag.py
abhijeets25012-tech pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Apr 9, 2026
The scheduler's asset (dataset) condition evaluation path had zero
INFO-level logging, making it impossible to debug why asset-triggered
DagRuns were created or skipped. This was a significant gap discovered
during a P1 customer incident where the root cause took hours to trace
because the scheduler was a complete black box for asset scheduling.

Add log lines for:
- ADRQ records loaded per DAG (count and DAG IDs)
- Asset condition evaluation result (met/not met per DAG)
- DAGs deferred due to max_active_runs
- Asset-triggered DagRun creation (DAG ID, triggered_date, queued count)
- Consumed asset events count per DagRun
- ADRQ rows deleted after DagRun creation

* Address review feedback: fix casing in log messages and mypy error

- Change "DAGs" to "Dags" in asset-triggered log messages (dag.py)
- Fix mypy attr-defined error by casting session.execute() result to
  CursorResult, matching the existing pattern in delete_dag.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants