Add team_name tag to remaining multi-team metrics#68601
Merged
ferruzzi merged 7 commits intoJun 18, 2026
Conversation
ferruzzi
marked this pull request as ready for review
June 17, 2026 00:17
ferruzzi
requested review from
XD-DENG,
amoghrajesh,
ashb,
dstandish,
hussein-awala and
kaxil
as code owners
June 17, 2026 00:17
2 tasks
vincbeck
approved these changes
Jun 17, 2026
dstandish
reviewed
Jun 17, 2026
dstandish
approved these changes
Jun 17, 2026
The mixin runs inside task execution, so the running task instance's stats_tags carry team_name when present. Merge it into the operator tag for all five resumable_job counters (reconnect_attempt, reconnect_success, already_succeeded, terminal_resubmit, fresh_submit).
ferruzzi
force-pushed
the
ferruzzi/multi-team/ti-metric-straggler
branch
from
June 17, 2026 22:51
98b4f75 to
74505e7
Compare
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.
Part 7 of 6 😅 , adding a few that I missed or don't fit neatly into one of the existing categories.
Follow-up to #68108
Can be reviewed/merged in parallel with #68367, #68589, #68593, #68594, and #68599
This should be the last one.
For posterity: In order to check if I got them all, I pointed Claude Opus 4.8 at the codebase with the following prompt:
A metric can be tied to a team if:
Metrics which do not have emit sites, metrics which only exist in providers, and metrics which can not be tied to a team are considered out of scope for this discussion.
Metrics which are included in the PR list below are considered done and should not be included in the list of remaining work.
shared/observability/src/airflow_shared/observability/metrics/metrics_template.yamlRelated PRs:
and this was the generated report:
Multi-Team Metrics: Final Count
Categorization of all 125 metrics in the registry (
metrics_template.yaml), based on the 7 related PRs and a trace of every emit site.How the 7 PRs map
The PRs explicitly tag 47 metrics. A further 9 are already covered indirectly
because they emit through
DagRun.stats_tags/TaskInstance.stats_tags/RuntimeTaskInstance.stats_tags, all of which were giventeam_namein 68108.So 56 are Done.
1) Done (56)
Directly tagged by a listed PR:
pool.open_slots,pool.queued_slots,pool.running_slots,pool.deferred_slots,pool.scheduled_slots,pool.starving_tasks,ti.start,operator_successes,operator_failures,ti_successes,ti_failures,task.durationasset.updates,asset.triggered_dagrunsdeadline_alerts.deadline_created,deadline_alerts.deadline_missed,deadline_alerts.deadline_not_missedexecutor.open_slots,executor.queued_tasks,executor.running_tasksscheduler.tasks.killed_externally,dagrun.schedule_delay,dagrun.duration.failed,ti.scheduled,ti.queued,ti.running,ti.deferred,task_instances_without_heartbeats_killeddag_processing.other_callback_count,dag_processing.last_run.seconds_ago,dag_processing.processes,dag_processing.processor_timeouts,dag_processing.callback_only_count,dag_processing.last_duration,dag.callback_exceptionstriggerer_heartbeat,triggers.succeeded,triggers.failed,triggers.running,triggerer.capacity_left,task.scheduled_duration,task.queued_duration,resumable_job.fresh_submit,resumable_job.already_succeeded,resumable_job.terminal_resubmit,resumable_job.reconnect_attempt,resumable_job.reconnect_successDone indirectly (emit through a stats_tags source that now carries
team_name):ti.finish(task-sdkrun(), shares theti.stats_tagsvariable)previously_succeeded(taskinstance.py,ti.stats_tags)task_removed_from_dag,task_restored_to_dag,task_instance_created(dagrun.py,self.stats_tags)dagrun.dependency-check,dagrun.first_task_scheduling_delay,dagrun.first_task_start_delay,dagrun.duration.success(dagrun.py,self.stats_tags)2) Remaining work (6)
Team-attributable, emit site has a team identity, but no
team_nametag yet:connection_test.reaped(scheduler reaper;ct.team_nameis literally in scope and logged one line above thestats.incr, onlyprior_stateis tagged)connection_test.success(worker connection-test supervisor; per connection-test row)connection_test.failed(same)connection_test.hook_duration(same)scheduler.executor_heartbeat_duration(loops overself.executors; eachexecutor.team_nameis available, tagged only by executor class)triggers.blocked_main_thread(emitted in a team-scoped triggerer'sTriggerRunner;team_namelives on the runner/supervisor but is not plumbed to this emit)Two of these are more borderline than the others:
scheduler.executor_heartbeat_durationand
triggers.blocked_main_threadare component-level (team-scoped executor /team-scoped triggerer). They satisfy the signal list, but if those components are
considered "shared," they'd drop to non-team. The four
connection_test.*rows areclean Remaining items per the explicit "connection-test row" signal.
3) Out of Scope
Sorted by reason.
Legacy / no emit site (6)
local_task_job.task_exit(only in the validator regex; no emit)dag_file_processor_timeouts(marked DEPRECATED; no emit)dag_processing.manager_stalls(no emit)dag_file_refresh_error(no emit)dag_processing.last_num_of_db_queries.{dag_file}(stored onDagFileStat, never emitted)collect_db_dags(no emit anywhere)Provider-only (28)
celery.task_timeout_error,celery.execute_command.failureol.emit.failed,ol.event.size,ol.emit.attempts,ol.extractedge_worker.status,edge_worker.connected,edge_worker.maintenance,edge_worker.jobs_active,edge_worker.concurrency,edge_worker.free_concurrency,edge_worker.num_queues,edge_worker.heartbeat_count,edge_worker.ti.start,edge_worker.ti.finishedge_executor.sync.durationkubernetes_executor.pod_creation_status,kubernetes_executor.pod_deletion_status,kubernetes_executor.pod_patching_status,kubernetes_executor.clear_not_launched_queued_tasks.duration,kubernetes_executor.adopt_task_instances.duration,kubernetes_executor.pod_creation,kubernetes_executor.pod_deletion,kubernetes_executor.pod_patchingbatch_executor.adopt_task_instances.duration,ecs_executor.adopt_task_instances.duration,lambda_executor.adopt_task_instances.durationNon-team (shared infrastructure or cross-team aggregate) (29)
{job_name}_start,{job_name}_end,{job_name}_heartbeat_failure,scheduler_heartbeat,dag_processor_heartbeatscheduler.orphaned_tasks.cleared,scheduler.orphaned_tasks.adopted,scheduler.critical_section_busy,scheduler.tasks.starving,scheduler.tasks.executable,scheduler.dagruns.running,scheduler.critical_section_duration,scheduler.critical_section_query_duration,scheduler.scheduler_loop_durationdag_processing.file_path_queue_update_count,dag_processing.import_errors,dag_processing.total_parse_time,dag_processing.file_path_queue_size,dagbag_sizeasset.orphanedapi_server.dag_bag.cache_hit,api_server.dag_bag.cache_miss,api_server.dag_bag.cache_clear,api_server.dag_bag.cache_sizeconnection_test.active,connection_test.pending,connection_test.dispatch_durationairflow.io.load_filesystems,serde.load_serializers4) Cross-check
Was generative AI tooling used to co-author this PR?
Interesting question..... see description; Claude was used to verify the scope, not sure if that counts.
{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.