Skip to content

Emit dag_processing.last_run.seconds_ago with dag_file as a tag#62487

Merged
jscheffl merged 1 commit into
apache:mainfrom
hussein-awala:improve_dag_processing_last_run_seconds_ago
Jun 14, 2026
Merged

Emit dag_processing.last_run.seconds_ago with dag_file as a tag#62487
jscheffl merged 1 commit into
apache:mainfrom
hussein-awala:improve_dag_processing_last_run_seconds_ago

Conversation

@hussein-awala

@hussein-awala hussein-awala commented Feb 25, 2026

Copy link
Copy Markdown
Member

Moves dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric dag_processing.last_run.seconds_ago.

The new metric is emitted with three tags:

  • file_path: the full (normalized) relative file path
  • bundle_name: the (normalized) bundle name
  • file_name: the (normalized) file name stem

file_path and bundle_name together uniquely identify a DAG file (the same file name can exist in different folders or bundles). file_name is kept as a tag to ease migration from the legacy interpolated metric.

The old interpolated name dag_processing.last_run.seconds_ago.{dag_file} is registered as the metric's legacy_name, so it is still emitted by default and can be disabled via [metrics] legacy_names_on, preserving backward compatibility.

Comment thread airflow-core/src/airflow/dag_processing/manager.py Outdated
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Apr 13, 2026
@github-actions github-actions Bot closed this Apr 19, 2026
@hussein-awala hussein-awala reopened this Jun 11, 2026
@hussein-awala hussein-awala removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 11, 2026
@hussein-awala hussein-awala marked this pull request as draft June 11, 2026 08:32
@hussein-awala hussein-awala force-pushed the improve_dag_processing_last_run_seconds_ago branch from ed36b84 to 5711236 Compare June 11, 2026 08:34
@hussein-awala hussein-awala marked this pull request as ready for review June 11, 2026 08:35
@eladkal eladkal added this to the Airflow 3.3.0 milestone Jun 11, 2026
@eladkal eladkal requested a review from jedcunningham June 11, 2026 08:42
Move dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric
dag_processing.last_run.seconds_ago with file_path, bundle_name and
file_name tags. file_path and bundle_name together uniquely identify a
DAG file (the same file name can exist in different folders or bundles),
and file_name is kept as a tag to ease migration from the legacy metric.

The legacy interpolated name is registered as the metric's legacy_name,
so it is still emitted by default (controlled by [metrics] legacy_names_on),
preserving backward compatibility.
@hussein-awala hussein-awala force-pushed the improve_dag_processing_last_run_seconds_ago branch from 5711236 to f74c3b3 Compare June 11, 2026 11:53
@jscheffl jscheffl merged commit 06d4b1e into apache:main Jun 14, 2026
77 checks passed
pgagnon pushed a commit to pgagnon/airflow that referenced this pull request Jun 15, 2026
…2487)

Move dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric
dag_processing.last_run.seconds_ago with file_path, bundle_name and
file_name tags. file_path and bundle_name together uniquely identify a
DAG file (the same file name can exist in different folders or bundles),
and file_name is kept as a tag to ease migration from the legacy metric.

The legacy interpolated name is registered as the metric's legacy_name,
so it is still emitted by default (controlled by [metrics] legacy_names_on),
preserving backward compatibility.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Jun 16, 2026
…2487)

Move dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric
dag_processing.last_run.seconds_ago with file_path, bundle_name and
file_name tags. file_path and bundle_name together uniquely identify a
DAG file (the same file name can exist in different folders or bundles),
and file_name is kept as a tag to ease migration from the legacy metric.

The legacy interpolated name is registered as the metric's legacy_name,
so it is still emitted by default (controlled by [metrics] legacy_names_on),
preserving backward compatibility.
dingo4dev pushed a commit to dingo4dev/airflow that referenced this pull request Jun 16, 2026
…2487)

Move dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric
dag_processing.last_run.seconds_ago with file_path, bundle_name and
file_name tags. file_path and bundle_name together uniquely identify a
DAG file (the same file name can exist in different folders or bundles),
and file_name is kept as a tag to ease migration from the legacy metric.

The legacy interpolated name is registered as the metric's legacy_name,
so it is still emitted by default (controlled by [metrics] legacy_names_on),
preserving backward compatibility.
RulerChen pushed a commit to RulerChen/airflow that referenced this pull request Jun 16, 2026
…2487)

Move dag_processing.last_run.seconds_ago.{dag_file} to a tagged metric
dag_processing.last_run.seconds_ago with file_path, bundle_name and
file_name tags. file_path and bundle_name together uniquely identify a
DAG file (the same file name can exist in different folders or bundles),
and file_name is kept as a tag to ease migration from the legacy metric.

The legacy interpolated name is registered as the metric's legacy_name,
so it is still emitted by default (controlled by [metrics] legacy_names_on),
preserving backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants