1.45.0's stop-decoding-bytes-attributes change silently breaks downstream instrumentation that relied on the old coercion
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- observability
Hướng nghiên cứu
Bắt đầu từ mục changelog của phiên bản 1.45.0 và kiểm tra nơi duy trì các ghi chú di chuyển. Ghi lại rằng các thuộc tính có giá trị là bytes hiện vẫn giữ nguyên là bytes và có thể xuất hiện dưới dạng AnyValue.bytes_value thay vì các chuỗi JSON đã giải mã, đồng thời liên kết issue LangSmith liên quan làm tiêu chí hoàn tất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 2.6k
- Fork
- 1k
- Merge trung bình
- 5 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-telemetry/opentelemetry-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-python#5695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
open-telemetry/opentelemetry-python#5661 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-python#5638 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
open-telemetry/opentelemetry-python#5624 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
open-telemetry/opentelemetry-python#5574 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của open-telemetry/opentelemetry-python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
letsencrypt/cp-cps#353 ·
-
Marble Madness II is missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DOI-USGS/pywatershed#421 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
python-pillow/Pillow#10087 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày