xBis7 commented on code in PR #62705:
URL: https://github.com/apache/airflow/pull/62705#discussion_r2872588128
##########
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:
They are.
It goes like this
* check the `legacy_name_tags` and cross-reference them with the variables
in the YAML file
* set the `legacy_name_tags` as variables in the legacy name
* build the legacy metric name
* export the legacy metric with the `tags` param
* merge the `tags` and the `legacy_name_tags`
* export the new name with the merged dictionary as tags
That was actually a bug because, by just setting the tags, there weren't any
available variables for the legacy name.
I've added comments in the code to explain the above.
The `legacy_name_tags` are going to end up as regular tags for the modern
name. And the `tags` is just for whatever tag is set on both 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]