Emit metric dag auto paused#69078
Open
takayoshi-makabe wants to merge 3 commits into
Open
Conversation
Comment on lines
950
to
952
| ) | ||
| stats.incr("dag.auto_paused", tags=self.stats_tags) | ||
| session.add( |
Author
There was a problem hiding this comment.
dag.*namespace fits because auto-pause is aDagModelstate change, not a single-run event
(dagrun.*).self.stats_tagsalready containsdag_idandrun_type, consistent with other metric call sites
in this file.
Comment on lines
+1152
to
+1155
| mock_stats_incr.assert_any_call( | ||
| "dag.auto_paused", | ||
| tags={"dag_id": dag_id, "run_type": DagRunType.MANUAL}, | ||
| ) |
Author
There was a problem hiding this comment.
assert_any_call instead of assert_called_once_with because update_state() emits multiple stats.incr calls (task state changes, duration, etc.) before reaching the auto-pause check.
Contributor
|
CI falling |
The metric was emitted in code but missing from the registry, causing the check-metrics-synced-with-registry static check to fail.
Author
|
I fixed it. The commands below execute successfully. uv run python scripts/ci/prek/check_metrics_synced_with_the_registry.py airflow-core/src/airflow/models/dagrun.pyCould you please rerun the GitHub Actions? |
Author
|
@henry3260 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emit
dag.auto_pausedmetric when the scheduler automatically pauses a DAG after exceedingmax_consecutive_failed_dag_runs. Platform teams can now alert on this event directly via StatsD/OpenTelemetry without polling the database or correlating failure metrics manually.The metric includes
dag_idandrun_typetags via the existingstats_tagsproperty onDagRun.closes: #69004
Was generative AI tooling used to co-author this PR?
Claude Code
{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.