Add team_name to Multi-Team metrics #68108
Merged
Merged
Conversation
ferruzzi
requested review from
XD-DENG,
amoghrajesh,
ashb and
kaxil
as code owners
June 5, 2026 22:30
vincbeck
reviewed
Jun 8, 2026
ferruzzi
force-pushed
the
ferruzzi/multi-team/metrics
branch
from
June 8, 2026 19:52
a65c4cc to
30b8c42
Compare
vincbeck
approved these changes
Jun 8, 2026
ferruzzi
force-pushed
the
ferruzzi/multi-team/metrics
branch
from
June 8, 2026 21:24
30b8c42 to
96763f1
Compare
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>
vincbeck
approved these changes
Jun 9, 2026
ferruzzi
force-pushed
the
ferruzzi/multi-team/metrics
branch
from
June 9, 2026 20:48
2e0ee44 to
b3f1c00
Compare
o-nikolas
approved these changes
Jun 10, 2026
o-nikolas
left a comment
Contributor
There was a problem hiding this comment.
looks good, just some minor nits/comments
1 task
2 tasks
1 task
This was referenced Jun 15, 2026
dingo4dev
pushed a commit
to dingo4dev/airflow
that referenced
this pull request
Jun 16, 2026
* Add team_name to Multi-Team metrics 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 was referenced Jun 19, 2026
1 task
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.