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


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -253,8 +254,13 @@ class RuntimeTaskInstance(TaskInstance):
 
     @property
     def stats_tags(self) -> dict[str, str]:
-        """Metric tags for this task instance, including team_name when 
available."""
-        tags: dict[str, str] = {"dag_id": self.dag_id, "task_id": self.task_id}
+        """Metric tags for this task instance, including dag tags and 
team_name when available."""
+        tags: dict[str, str] = {}
+        if conf.getboolean("metrics", "dag_tags_in_metrics", fallback=False):
+            tags.update(build_dag_metric_tags(self.task.dag.tags))
+        # Built-in keys always win on collision.
+        tags["dag_id"] = self.dag_id
+        tags["task_id"] = self.task_id
         if self._ti_context_from_server and 
self._ti_context_from_server.dag_run.team_name:
             tags["team_name"] = self._ti_context_from_server.dag_run.team_name
         return tags

Review Comment:
   Now it should be consistent



-- 
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