Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

1.45.0's stop-decoding-bytes-attributes change silently breaks downstream instrumentation that relied on the old coercion

未关闭 适合新手
#5,700 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
70/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
observability

调研方向

从 1.45.0 的 changelog 条目开始,检查迁移说明维护在哪里。记录值为 bytes 的属性现在仍保持为 bytes,并且可能以 AnyValue.bytes_value 的形式出现,而不是解码后的 JSON 字符串;将相关的 LangSmith issue 作为完成标准链接出来。

由索引模型根据 Issue 内容生成。

描述

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 bytes type 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.

主要语言
Python
星标
2.6k
派生
1k
平均合并
5 天 17 小时
30 天内合并 PR
25

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

open-telemetry/opentelemetry-python 的其他 Issue

查看 open-telemetry/opentelemetry-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。