jscheffl commented on code in PR #68078:
URL: https://github.com/apache/airflow/pull/68078#discussion_r3399118024


##########
airflow-core/src/airflow/api_fastapi/app.py:
##########
@@ -71,8 +71,43 @@ class _AuthManagerState:
     _lock = threading.Lock()
 
 
+def _initialize_task_sdk_stats() -> None:
+    """
+    Initialize the Task SDK ``Stats`` singleton in the API server process.
+
+    Unlike the scheduler, triggerer, dag-processor, executors and task runner, 
the API server
+    never called ``Stats.initialize(...)``. Since the auto-initializing 
``Stats`` was removed
+    (#63932) that singleton stays a ``NoStatsLogger`` in the API server 
process, so any metric
+    emitted through the Task SDK ``Stats`` singleton from code served by the 
API server is
+    silently dropped.
+
+    The case that surfaced this is the Edge Worker REST API 
(``/edge_worker/v1/...``): its
+    heartbeat handler records ``edge_worker.*`` metrics through the Task SDK 
``Stats`` singleton
+    (resolved by the Edge provider via ``airflow.providers.common.compat``), 
but the problem is
+    not specific to Edge.
+

Review Comment:
   I think this "history" and reference to Edge also is not needed. Git blame 
is sufficient in my view to track back.
   ```suggestion
   ```



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