uranusjr commented on code in PR #56690:
URL: https://github.com/apache/airflow/pull/56690#discussion_r2674707354
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -988,6 +1017,13 @@ def _on_term(signum, frame):
_push_xcom_if_needed(result, ti, log)
+ # Send metrics to Stats backend
+ if end_resources is not None:
+ cpu_percent, memory_mb = end_resources
+ stats_tags = {"dag_id": ti.dag_id, "task_id": ti.task_id}
+ Stats.gauge(f"task.cpu_usage_percent.{ti.dag_id}.{ti.task_id}",
cpu_percent, tags=stats_tags)
+ Stats.gauge(f"task.memory_usage_mb.{ti.dag_id}.{ti.task_id}",
memory_mb, tags=stats_tags)
Review Comment:
Why is this done here specifically? Not earlier or later?
--
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]