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


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -96,6 +100,33 @@
     from airflow.sdk.types import RuntimeTaskInstanceProtocol as RuntimeTI
 
 logger = logging.getLogger(__name__)
+tracer = trace.get_tracer(__name__)
+
+
+def _make_trigger_span(
+    ti: TaskInstanceDTO | None, trigger_id: int, name: str
+) -> _AgnosticContextManager[trace.Span]:
+    parent_context = (
+        TraceContextTextMapPropagator().extract(ti.context_carrier) if ti and 
ti.context_carrier else None
+    )
+    span_name = f"trigger.{ti.task_id}" if ti else f"trigger.{trigger_id}"
+    if ti and ti.map_index >= 0:
+        span_name += f"_{ti.map_index}"
+    attributes: dict[str, str | int] = {
+        "airflow.trigger.name": name,
+    }
+    if ti:

Review Comment:
   i updated it to handle non-ti better but i think we need to defer adding 
other attrs for non-ti .... i'm not sure what information we have at this point 
since there's nothing like 'asset' on the BaseTrigger object.



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