Add team_name to Multi-Team metrics #68108
Open
ferruzzi wants to merge 1 commit into
Open
Conversation
Add `team_name` to ~35 metrics (DagRun, TaskInstance, pool slots) for multi-team Airflow deployments. When multi_team is disabled or a DAG has no team, the tag is omitted entirely (no change to existing systems). Changes: - Add `team_name` to `DagRun.stats_tags` and `TaskInstance.stats_tags` - Set `_team_name` on `DagRun`/`TI` objects in 4 scheduler injection points - Add persistent `_dag_id_to_team_name` cache on `SchedulerJobRunner` - Add `stats_tags` property to `RuntimeTaskInstance` (Task SDK) - Add `team_name` to pool slot gauge metrics via `pool.get_name_to_team_name_mapping` Co-authored-by: Niko Oliveira <onikolas@amazon.com>
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.
Add
team_nameto ~35 metrics (DagRun, TaskInstance, pool slots) for multi-team Airflow deployments. When multi_team is disabled or a DAG has no team, the tag is omitted entirely (no change to existing systems).Changes:
team_nametoDagRun.stats_tagsandTaskInstance.stats_tags_team_nameonDagRun/TIobjects in 4 scheduler injection points_dag_id_to_team_namecache onSchedulerJobRunnerstats_tagsproperty toRuntimeTaskInstance(Task SDK)team_nameto pool slot gauge metrics viapool.get_name_to_team_name_mappingRemaining metrics will be done in (6 or 7?) parallel chunks after this lands.
Co-authored-by: Niko Oliveira onikolas@amazon.com
Was generative AI tooling used to co-author this PR?
{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.