uranusjr commented on code in PR #61079:
URL: https://github.com/apache/airflow/pull/61079#discussion_r2730959939
##########
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 know this doesn’t really matter in practice, but would it be better to log
`{"file_name": None}` instead of not logging at all?
--
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]