xBis7 commented on code in PR #62705:
URL: https://github.com/apache/airflow/pull/62705#discussion_r2873280344


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -1260,11 +1261,11 @@ def process_parse_results(
         file_name = normalize_name_for_stats(Path(relative_fileloc).stem)
         # bundle_name is included to distinguish files with the same name 
across different bundles
         normalized_bundle = normalize_name_for_stats(bundle_name)
-        
Stats.timing(f"dag_processing.last_duration.{normalized_bundle}.{file_name}", 
stat.last_duration)
-        Stats.timing(
+        DualStatsManager.timing(
             "dag_processing.last_duration",
             stat.last_duration,
-            tags={"file_name": file_name, "bundle_name": normalized_bundle},
+            tags={},
+            legacy_name_tags={"bundle_name": normalized_bundle, "file_name": 
file_name},

Review Comment:
   I know. The behavior is consistent with before but the `DualStatsManager` 
logic is confusing. I renamed the `extra_tags` param to `legacy_name_tags` to 
make it more intuitive and added comments but it's still not that clear.
   
   Do you have any suggestions?
   
   Before the DualStatsManager
   * legacy metrics didn't have any tags and everything was included in the name
   * modern metrics had a simpler name and all the variables from the legacy 
metric name, as tags
   
   The thing is that I'm trying to cover an edge case where the legacy and the 
modern metric had some extra tags, apart from the name variables.



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