jedcunningham commented on code in PR #63839:
URL: https://github.com/apache/airflow/pull/63839#discussion_r2976912104
##########
airflow-core/src/airflow/models/taskmap.py:
##########
@@ -38,6 +40,7 @@
from airflow.models.taskinstance import TaskInstance
from airflow.serialization.definitions.mappedoperator import Operator
+tracer = trace.get_tracer(__name__)
Review Comment:
```suggestion
tracer = trace.get_tracer(__name__)
```
Nit (surprised ruff is okay with this as-is?)
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -96,6 +100,34 @@
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
+ )
+ attributes: dict[str, str | int] = {
+ "airflow.trigger.name": name,
+ }
+ if ti:
+ span_name = f"trigger.{ti.task_id}" if ti else f"trigger.{trigger_id}"
Review Comment:
```suggestion
span_name = f"trigger.{ti.task_id}"
```
We know ti is truthy already, so it'll never this the else.
--
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]