o-nikolas commented on code in PR #61079:
URL: https://github.com/apache/airflow/pull/61079#discussion_r2733009418
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -1195,10 +1195,11 @@ def process_parse_results(
run_count=run_count + 1,
)
- # TODO: AIP-66 emit metrics
- # file_name = Path(dag_file.path).stem
- # Stats.timing(f"dag_processing.last_duration.{file_name}",
stat.last_duration)
- # Stats.timing("dag_processing.last_duration", stat.last_duration,
tags={"file_name": file_name})
+ # Note: relative_fileloc has a None default. In practice it is always
provided but code defensively here in case
+ if relative_fileloc is not None and stat.last_duration is not None:
+ file_name = Path(relative_fileloc).stem
+ Stats.timing(f"dag_processing.last_duration.{file_name}",
stat.last_duration)
+ Stats.timing("dag_processing.last_duration", stat.last_duration,
tags={"file_name": file_name})
Review Comment:
I think that would get confusing if we had multiple instances where the
fileloc was None. It's generally a very undefined situation that would confuse
users if we emitted metrics for it I think.
--
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]