dstandish commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r2975804876


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -431,6 +436,45 @@ def ti_update_state(
         )
 
 
+def _emit_task_span(ti, state):
+    # just to be safe
+    if not ti.dag_run:
+        return
+    if not isinstance(ti.dag_run.context_carrier, dict):
+        return
+    if not isinstance(ti.context_carrier, dict):
+        return

Review Comment:
   we do need it.
   here's why.
   both the DR span and the Task run span are "synthetic" spans. they are only 
emitted at the conclusion of the TI or Dag run, and their start time is 
backdated as of the actual start.
   here, we are emitting the TI span.  It needs to be a child of the DR span. 
we need to know the DR context so we can emit the task span as a child of the 
DR. and we need to know the TI context info so we know what span id and trace 
id to use.



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