Repository navigation
[v3-2-test] Stringify task_instance.id when setting OTEL span attribute (#66053) - #66645
Merged
Merged
Conversation
…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>
1 task done
potiuk
marked this pull request as ready for review
May 10, 2026 01:39
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>
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.
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:
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
Signed-off-by: Chris 63758245+c-premus@users.noreply.github.com
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