You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by sh...@apache.org on 2024/09/25 18:12:59 UTC
(airflow) branch main updated: Fix the span link of task instance to point to the correct span in the scheduler_job_loop (#42430)
This is an automated email from the ASF dual-hosted git repository.
shahar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ae6ed8a948 Fix the span link of task instance to point to the correct span in the scheduler_job_loop (#42430)
ae6ed8a948 is described below
commit ae6ed8a9480ec18b2b14804821c1a4e9f1a91f3c
Author: Howard Yoo <32...@users.noreply.github.com>
AuthorDate: Wed Sep 25 13:12:52 2024 -0500
Fix the span link of task instance to point to the correct span in the scheduler_job_loop (#42430)
---
airflow/traces/otel_tracer.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/airflow/traces/otel_tracer.py b/airflow/traces/otel_tracer.py
index 1f87e458d3..c6d493db14 100644
--- a/airflow/traces/otel_tracer.py
+++ b/airflow/traces/otel_tracer.py
@@ -199,7 +199,12 @@ class OtelTrace:
_links.append(
Link(
- context=trace.get_current_span().get_span_context(),
+ context=SpanContext(
+ trace_id=trace.get_current_span().get_span_context().trace_id,
+ span_id=span_id,
+ is_remote=True,
+ trace_flags=TraceFlags(0x01),
+ ),
attributes={"meta.annotation_type": "link", "from": "parenttrace"},
)
)