1.45.0's stop-decoding-bytes-attributes change silently breaks downstream instrumentation that relied on the old coercion
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 70/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- observability
Research direction
Start from the 1.45.0 changelog entry and check where migration notes are maintained. Document that bytes-valued attributes now remain bytes and may appear as AnyValue.bytes_value rather than decoded JSON strings, and link the related LangSmith issue as the completion criterion.
Written by the indexing model from the issue text.
Description
Not a bug report — flagging a compatibility edge the 1.45.0 changelog entry
didn't call out, in case it's worth a line in the migration notes for anyone
who greps for it later.
If a
bytestype is set as an attribute value in the SDK, it will no longer
be utf-8 decoded to a string, instead it will be passed along as is in
accordance with the OTEL spec.
Before 1.45.0, Span.set_attribute(key, some_bytes) silently coerced
some_bytes to str via utf-8 decode. After 1.45.0, the same call now
exports AnyValue.bytes_value on the wire. That's the documented, correct,
spec-compliant behaviour, and I'm not asking for it to change.
What I ran into: at least one popular instrumentation library
(langchain-ai/langsmith-sdk's OTel exporter — reported separately, langchain-ai/langsmith-sdk#3602)
has, across every version I checked, called set_attribute with a bytes
value for its main prompt/completion payload, apparently unintentionally,
relying on the old SDK behaviour to turn it back into readable text. Upgrading
only opentelemetry-sdk/opentelemetry-api (no code change, no langsmith
version change) silently turned every one of those attributes from a JSON
string into an opaque binary blob for anyone reading the exported traces —
no error, no warning, same span count, same attribute keys, just a different
wire type carrying the same bytes.
Nothing to fix here since the change is correct per spec, and it's the
instrumentation library's bug for passing bytes when it meant str. Just
noting it in case it's useful to link from the 1.45.0 changelog entry or the
migration guide, since this specific failure mode (payload silently becomes
unreadable, no exception anywhere) seems like exactly the kind of thing that's
hard for an instrumentation-library author to notice in their own tests if
they only assert on in/substring checks against the in-memory exporter
rather than the attribute's actual type.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 27
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-python
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5695 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
open-telemetry/opentelemetry-python#5661 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-python#5638 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-telemetry/opentelemetry-python#5624 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-python#5574 · 1 comment ·
Maintainers usually reply within 2 days
All issues in open-telemetry/opentelemetry-python
Similar issues
-
customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-cli#34150 · 1 comment ·
Maintainers usually reply within 1 day
-
community-request
Difficulty 1/5 Under an hour Newbie friendliness 95/100
NVIDIA-NeMo/Curator#2464 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WeblateOrg/translation-finder#1099 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7997 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day