Skip to content

Add scheduler.dagruns.not_started gauge metric for late-starting scheduled DagRuns#69086

Open
takayoshi-makabe wants to merge 1 commit into
apache:mainfrom
takayoshi-makabe:emit-metric-dagrun-late
Open

Add scheduler.dagruns.not_started gauge metric for late-starting scheduled DagRuns#69086
takayoshi-makabe wants to merge 1 commit into
apache:mainfrom
takayoshi-makabe:emit-metric-dagrun-late

Conversation

@takayoshi-makabe

@takayoshi-makabe takayoshi-makabe commented Jun 27, 2026

Copy link
Copy Markdown

Add a new scheduler.dagruns.not_started gauge metric that tracks scheduled DagRuns that have not started within a configurable threshold. Users can alert on scheduling latency directly via StatsD/OpenTelemetry without writing custom DB queries.

The threshold is configurable via [scheduler] dagrun_late_threshold (default 15.0 seconds), which mirrors the default used by Prefect's MarkLateRuns service (PREFECT_API_SERVICES_LATE_RUNS_AFTER_SECONDS).

DB impact:

Two COUNT(*) queries are added to the existing dagrun_metrics_interval (default 30 s) polling cycle, following the same pattern as _emit_running_dags_metric. The dag table query uses idx_next_dagrun_create_after; the dag_run query relies on the existing idx_dag_run_queued_dags index.


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

Claude Code


  • 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.

@boring-cyborg boring-cyborg Bot added area:ConfigTemplates area:Scheduler including HA (high availability) scheduler labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ConfigTemplates area:Scheduler including HA (high availability) scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant