This is an automated email from the ASF dual-hosted git repository.

shahar pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-10-test by this push:
     new 7a32215253 Fix the span link of task instance to point to the correct 
span in the scheduler_job_loop (#42430) (#42480)
7a32215253 is described below

commit 7a3221525316a6522e4639d3be4608ff0d2e6013
Author: Shahar Epstein <[email protected]>
AuthorDate: Thu Sep 26 00:45:18 2024 +0300

    Fix the span link of task instance to point to the correct span in the 
scheduler_job_loop (#42430) (#42480)
    
    (cherry picked from commit ae6ed8a9480ec18b2b14804821c1a4e9f1a91f3c)
    
    Co-authored-by: Howard Yoo <[email protected]>
---
 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 3d429ce342..78305a6178 100644
--- a/airflow/traces/otel_tracer.py
+++ b/airflow/traces/otel_tracer.py
@@ -198,7 +198,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"},
             )
         )

Reply via email to