Introduce parent task spans and nest worker and trigger spans under them#63839
Introduce parent task spans and nest worker and trigger spans under them#63839dstandish merged 38 commits intoapache:mainfrom
Conversation
1e8cecf to
89ef70a
Compare
89ef70a to
ffde871
Compare
oh interesting you are right thanks for pointing that out this stuff is so tricky |
xBis7
left a comment
There was a problem hiding this comment.
@dstandish Thanks for the PR! I posted a few questions.
ok @xBis7 i think i fixed it! i updated the screen shot in the description. confirm when you have a chance! |
@dstandish I tested it locally and now it looks good! |
This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.
xBis7
left a comment
There was a problem hiding this comment.
Thanks for addressing all my comments! You've mentioned that you tested it with mapped tasks and fixed an issue. Pending a green CI.
LGTM!
Move all local opentelemetry and observability imports to the top of each test file, fix TestMakeTaskCarrier fixture to also patch the shared lib tracer so new_task_run_carrier(None) works correctly, and fix assertion indentation in test_emit_dagrun_span_with_none_or_empty_carrier.
test_insert_mapping_includes_context_carrier and test_clear_task_instances_resets_context_carrier only patched airflow.models.taskinstance.tracer, but new_task_run_carrier uses the tracer from airflow._shared.observability.traces. Without patching that, older OTel versions (LowestDeps CI) produce an invalid span and an empty carrier. Apply the same fix already used in TestMakeTaskCarrier.
…hem (#63839) This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.
…hem (apache#63839) This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.
…hem (apache#63839) This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.
…hem (apache#63839) This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.

This lets us tie together the worker and trigger phases of task execution. Also lets us see the delta between task queued time and task start time.
example output