Skip to content

[v3-2-test] Stringify task_instance.id when setting OTEL span attribute (#66053) - #66645

Merged
potiuk merged 1 commit into
v3-2-testfrom
backport-8310049-v3-2-test
May 10, 2026
Merged

potiuk merged 1 commit into
v3-2-testfrom
backport-8310049-v3-2-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor
  • 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.


(cherry picked from commit 8310049)

Co-authored-by: Chris Premus 63758245+c-premus@users.noreply.github.com
Signed-off-by: Chris 63758245+c-premus@users.noreply.github.com

…te (#66053)

* 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.

---------
(cherry picked from commit 8310049)

Co-authored-by: Chris Premus <63758245+c-premus@users.noreply.github.com>
Signed-off-by: Chris <63758245+c-premus@users.noreply.github.com>
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label May 10, 2026
@potiuk
potiuk marked this pull request as ready for review May 10, 2026 01:39
@potiuk
potiuk merged commit 381297e into v3-2-test May 10, 2026
106 checks passed
@potiuk
potiuk deleted the backport-8310049-v3-2-test branch May 10, 2026 03:30
@vatsrahul1001 vatsrahul1001 added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label May 18, 2026
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants