IKholopov commented on code in PR #27155:
URL: https://github.com/apache/airflow/pull/27155#discussion_r1018513609


##########
airflow/jobs/local_task_job.py:
##########
@@ -282,6 +283,11 @@ def _run_mini_scheduler_on_child_tasks(self, session=None) 
-> None:
             )
             session.rollback()
 
+    def _log_return_code_metric(self, return_code: int):
+        Stats.incr(
+            
f'local_task_job.task_exit.{self.id}.{self.dag_id}.{self.task_instance.task_id}.{return_code}'
+        )

Review Comment:
   My reasoning for moving it here was to not mix the logic of processing 
exited task and preparing metric value + sending it.
   
   As there are plans to migrate metrics from StatsD to OpenTelemetry 
[AIP-49](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-49+OpenTelemetry+Support+for+Apache+Airflow),
 I thought it would be cleaner to keep these pieces of code that will need to 
be refactored in this migration separate from the other logic of the job. 



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