Repository navigation
Introduce parent task spans and nest worker and trigger spans under them - #63839
Merged
Merged
Conversation
dstandish
requested review from
XD-DENG,
amoghrajesh,
ashb,
bugraoz93,
choo121600,
dheerajturaga,
ephraimbuddy,
hussein-awala,
jason810496,
kaxil,
o-nikolas,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
March 17, 2026 18:06
dstandish
force-pushed
the
parent-task-span
branch
from
March 17, 2026 18:09
1e8cecf to
89ef70a
Compare
Contributor
Author
dstandish
force-pushed
the
parent-task-span
branch
from
March 17, 2026 22:05
89ef70a to
ffde871
Compare
Contributor
Contributor
Author
oh interesting you are right thanks for pointing that out this stuff is so tricky |
xBis7
reviewed
Mar 18, 2026
xBis7
left a comment
Contributor
There was a problem hiding this comment.
@dstandish Thanks for the PR! I posted a few questions.
Contributor
Author
ok @xBis7 i think i fixed it! i updated the screen shot in the description. confirm when you have a chance! |
Contributor
@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.
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.
jedcunningham
approved these changes
Mar 23, 2026
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.
vatsrahul1001
pushed a commit
that referenced
this pull request
Mar 25, 2026
…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.
aaron-y-chen
pushed a commit
to aaron-y-chen/airflow
that referenced
this pull request
Mar 30, 2026
…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.
Suraj-kumar00
pushed a commit
to Suraj-kumar00/airflow
that referenced
this pull request
Apr 7, 2026
…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.
abhijeets25012-tech
pushed a commit
to abhijeets25012-tech/airflow
that referenced
this pull request
Apr 9, 2026
…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.
xBis7
added a commit
to xBis7/airflow
that referenced
this pull request
Apr 17, 2026
This was referenced Apr 28, 2026
c-premus
added a commit
to c-premus/airflow
that referenced
this pull request
Apr 29, 2026
The execution API's _emit_task_span() was setting the
"airflow.task_instance.id" span attribute to the raw UUID object.
The OTEL SDK only accepts str/bytes/int/float/bool attribute values
(or homogeneous sequences thereof), so it dropped the attribute and
logged a warning per task state transition:
Invalid type UUID for attribute 'airflow.task_instance.id'
value. Expected one of ['bool', 'str', 'bytes', 'int', 'float']
or a sequence of those types
The fix is to stringify the UUID, matching the convention already
used in the same module (e.g. bind_contextvars(ti_id=str(...))).
The bug was introduced in apache#63839 and ships in 3.2.0 / 3.2.1.
Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
potiuk
pushed a commit
that referenced
this pull request
May 10, 2026
* Stringify task_instance.id when setting OTEL span attribute
The execution API's _emit_task_span() was setting the
"airflow.task_instance.id" span attribute to the raw UUID object.
The OTEL SDK only accepts str/bytes/int/float/bool attribute values
(or homogeneous sequences thereof), so it dropped the attribute and
logged a warning per task state transition:
Invalid type UUID for attribute 'airflow.task_instance.id'
value. Expected one of ['bool', 'str', 'bytes', 'int', 'float']
or a sequence of those types
The fix is to stringify the UUID, matching the convention already
used in the same module (e.g. bind_contextvars(ti_id=str(...))).
The bug was introduced in #63839 and ships in 3.2.0 / 3.2.1.
Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
* Add newsfragment for OTEL UUID attribute fix
Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
* Drop newsfragment per review feedback
Reviewer (henry3260) noted the newsfragment isn't needed for this fix.
---------
Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
potiuk
pushed a commit
that referenced
this pull request
May 10, 2026
…te (#66053) (#66645) * Stringify task_instance.id when setting OTEL span attribute The execution API's _emit_task_span() was setting the "airflow.task_instance.id" span attribute to the raw UUID object. The OTEL SDK only accepts str/bytes/int/float/bool attribute values (or homogeneous sequences thereof), so it dropped the attribute and logged a warning per task state transition: Invalid type UUID for attribute 'airflow.task_instance.id' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types The fix is to stringify the UUID, matching the convention already used in the same module (e.g. bind_contextvars(ti_id=str(...))). The bug was introduced in #63839 and ships in 3.2.0 / 3.2.1. * Add newsfragment for OTEL UUID attribute fix * Drop newsfragment per review feedback Reviewer (henry3260) noted the newsfragment isn't needed for this fix. --------- (cherry picked from commit 8310049) Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com> Co-authored-by: Chris Premus <63758245+c-premus@users.noreply.github.com>
jason810496
pushed a commit
to jason810496/airflow
that referenced
this pull request
May 11, 2026
…6053) * Stringify task_instance.id when setting OTEL span attribute The execution API's _emit_task_span() was setting the "airflow.task_instance.id" span attribute to the raw UUID object. The OTEL SDK only accepts str/bytes/int/float/bool attribute values (or homogeneous sequences thereof), so it dropped the attribute and logged a warning per task state transition: Invalid type UUID for attribute 'airflow.task_instance.id' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types The fix is to stringify the UUID, matching the convention already used in the same module (e.g. bind_contextvars(ti_id=str(...))). The bug was introduced in apache#63839 and ships in 3.2.0 / 3.2.1. Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com> * Add newsfragment for OTEL UUID attribute fix Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com> * Drop newsfragment per review feedback Reviewer (henry3260) noted the newsfragment isn't needed for this fix. --------- Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
vatsrahul1001
pushed a commit
that referenced
this pull request
May 20, 2026
…te (#66053) (#66645) * Stringify task_instance.id when setting OTEL span attribute The execution API's _emit_task_span() was setting the "airflow.task_instance.id" span attribute to the raw UUID object. The OTEL SDK only accepts str/bytes/int/float/bool attribute values (or homogeneous sequences thereof), so it dropped the attribute and logged a warning per task state transition: Invalid type UUID for attribute 'airflow.task_instance.id' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types The fix is to stringify the UUID, matching the convention already used in the same module (e.g. bind_contextvars(ti_id=str(...))). The bug was introduced in #63839 and ships in 3.2.0 / 3.2.1. * Add newsfragment for OTEL UUID attribute fix * Drop newsfragment per review feedback Reviewer (henry3260) noted the newsfragment isn't needed for this fix. --------- (cherry picked from commit 8310049) Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com> Co-authored-by: Chris Premus <63758245+c-premus@users.noreply.github.com>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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