Description
Go SDK tasks executed through the bundle gRPC path do not receive the task instance's OpenTelemetry context carrier. This breaks trace continuity at the Go task boundary, even though the bundle protobuf schema already provides an otel_context field.
Use case/motivation
Teams instrumenting Go SDK tasks and their downstream API calls need those spans to continue the trace created for the Airflow task instance. Without the remote parent context, Go task spans begin unrelated traces, making an end-to-end task execution difficult to observe and diagnose.
The expected behaviour is that the bundle gRPC client forwards string-valued carrier entries, the bundle server reconstructs the carrier, and the Go task extracts the W3C Trace Context into its context.Context. Task instrumentation and downstream calls can then inherit the remote parent span. Non-string carrier values should be ignored, consistently with Airflow's Python tracing path.
Related issues
|
tiBuilder := proto.TaskInstance_builder{ |
|
Id: proto.UUID_builder{Value: ptr(workload.TI.Id.String())}.Build(), |
|
DagId: &workload.TI.DagId, |
|
RunId: &workload.TI.RunId, |
|
TaskId: &workload.TI.TaskId, |
|
Hostname: workload.TI.Hostname, |
|
TryNumber: ptr((int32)(workload.TI.TryNumber)), |
|
// TODO: OtelContext support! |
|
// OtelContext: map[string]string{}, |
|
} |
|
workload := api.ExecuteTaskWorkload{ |
|
Token: executeTask.GetToken(), |
|
TI: bundlev1.TaskInstance{ |
|
DagId: ti.GetDagId(), |
|
Id: id, |
|
RunId: ti.GetRunId(), |
|
TaskId: ti.GetTaskId(), |
|
TryNumber: int(ti.GetTryNumber()), |
|
// TODO: support otel context carrier |
|
// ContextCarrier: (map[string]any)(ti.GetOtelContext()), |
|
}, |
Are you willing to submit a PR?
Code of Conduct
Description
Go SDK tasks executed through the bundle gRPC path do not receive the task instance's OpenTelemetry context carrier. This breaks trace continuity at the Go task boundary, even though the bundle protobuf schema already provides an
otel_contextfield.Use case/motivation
Teams instrumenting Go SDK tasks and their downstream API calls need those spans to continue the trace created for the Airflow task instance. Without the remote parent context, Go task spans begin unrelated traces, making an end-to-end task execution difficult to observe and diagnose.
The expected behaviour is that the bundle gRPC client forwards string-valued carrier entries, the bundle server reconstructs the carrier, and the Go task extracts the W3C Trace Context into its
context.Context. Task instrumentation and downstream calls can then inherit the remote parent span. Non-string carrier values should be ignored, consistently with Airflow's Python tracing path.Related issues
airflow/go-sdk/bundle/bundlev1/bundlev1client/grpc.go
Lines 92 to 101 in 1e7e525
airflow/go-sdk/bundle/bundlev1/bundlev1server/impl/plugin.go
Lines 142 to 152 in 1e7e525
Are you willing to submit a PR?
Code of Conduct