sortega commented on code in PR #68568:
URL: https://github.com/apache/airflow/pull/68568#discussion_r3551693298


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1374,6 +1374,12 @@ def process_executor_events(
             
.options(joinedload(TI.dag_run).selectinload(DagRun.created_dag_version))
             .options(joinedload(TI.dag_version))
         )
+        # When emitting Dag tags as metric tags, eager-load dag_model.tags so 
the per-finished-task
+        # ti_failures / operator_failures / task.*_duration metrics carry them 
without a per-TI lazy load.
+        if conf.getboolean("metrics", "dag_tags_in_metrics", fallback=False):
+            query = query.options(
+                
joinedload(TI.dag_run).joinedload(DagRun.dag_model).selectinload(DagModel.tags)

Review Comment:
   I've made the more direct join as you proposed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to