realtimetodie commented on code in PR #72458:
URL: https://github.com/apache/airflow/pull/72458#discussion_r3961927211


##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -604,7 +605,12 @@ def dag_tags_for_stats(self) -> dict[str, str]:
             # the load raises — swallow it so metric tagging never breaks the 
caller.
             if not self.dag_model or not self.dag_model.tags:
                 return {}
-            return build_dag_metric_tags(tag.name for tag in 
self.dag_model.tags)
+            tag_names = (tag.name for tag in self.dag_model.tags)
+            if airflow_conf.getboolean("metrics", "statsd_datadog_enabled", 
fallback=False) or airflow_conf.getboolean(
+                "metrics", "statsd_on", fallback=False
+            ):
+                return build_dag_metric_tags(tag_names)
+            return expand_dag_tags(tag_names)

Review Comment:
   @FrankYang0529 I moved the DAG tag normalization as suggested.
   
   In addition, the function `build_dag_tags` is now shared between spans and 
metrics.



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