🐛 Bug Report: Incomplete cache token migration after #4243 breaks Bedrock and Groq instrumentation
Maintainer thường phản hồi trong vòng 1 ngày
@Quantum-Enigma-dot đang làm issue này rồi.
Từ ngày 29/10/2026.
- #4667 của @Quantum-Enigma-dot — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- observability-sre
Hướng nghiên cứu
Bắt đầu với các tệp span_utils.py của Bedrock và Groq được nêu trong issue, sau đó tìm trong repository hai hằng số token bộ nhớ đệm đã bị xóa và kiểm tra các định nghĩa GenAIAttributes hiện tại. Chạy bài kiểm thử prompt caching và các bài kiểm thử span-utils của Groq được liệt kê trong báo cáo. Công việc hoàn tất khi việc sử dụng bộ nhớ đệm được ghi nhận thành công và các tham chiếu còn lại trong thời gian chạy cũng như trong kiểm thử không còn lỗi khi đối chiếu với nguồn semantic-conventions trong workspace.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which component is this bug for?
Bedrock Instrumentation
📜 Description
The semantic-convention migration in #4243 removed the following attributes from SpanAttributes:
SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENSSpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS
However, the Bedrock and Groq instrumentations still reference these attributes in runtime code.
When a response contains prompt-cache usage data, accessing the removed attributes raises AttributeError. Several tests in Bedrock, Groq, Google Generative AI, and Mistral AI also continue to reference the removed attributes.
This appears to be an incomplete migration from SpanAttributes to GenAIAttributes.
👟 Reproduction steps
- Clone the repository and enter the Bedrock instrumentation package:
cd packages/opentelemetry-instrumentation-bedrock
2.Run the prompt-caching test using the workspace version of opentelemetry-semantic-conventions-ai:
uv run --group test python -c "import sys; sys.path.insert(0, '../opentelemetry-semantic-conventions-ai'); import pytest; sys.exit(pytest.main(['tests/traces/test_prompt_caching.py']))"
3.Alternatively, verify directly that the attributes are absent:
```python
from opentelemetry.semconv_ai import SpanAttributes
print(
hasattr(
SpanAttributes,
"GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS",
)
)
# False
print(
hasattr(
SpanAttributes,
"GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS",
)
)
# False
4.Bedrock still accesses the missing attributes inside converse_usage_record():
SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS
SpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS
5.When cache usage is present, Python raises an AttributeError.
👍 Expected behavior
Bedrock and Groq should record prompt-cache token usage without raising an exception. All remaining references should use the current `GenAIAttributes` constants, or compatible aliases should remain available on `SpanAttributes` during the migration.
### 👎 Actual Behavior with Screenshots
When a cache-token code path accesses the removed constant, Python raises:
```text
AttributeError: type object 'SpanAttributes' has no attribute 'GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS'
The Bedrock prompt-caching test also fails when run against the current workspace version of opentelemetry-semantic-conventions-ai:
```text
FAILED tests/traces/test_prompt_caching.py::test_invoke_model_cache_tokens
The Groq span-utils suite produces six failures involving the same missing cache-read attribute.
🤖 Python Version
3.13.7
📃 Provide any additional context for the Bug.
I traced the regression to #4243.
That migration moved the cache-token constants to GenAIAttributes and removed them from SpanAttributes. Several packages were migrated, but remaining runtime references in Bedrock and Groq were not updated.
The issue can be masked when package-specific environments resolve the previously published opentelemetry-semantic-conventions-ai==0.5.1, where the attributes are still available. Running the tests against the current workspace semantic-conventions source exposes the regression.
Relevant runtime locations include:
packages/opentelemetry-instrumentation-bedrock/opentelemetry/instrumentation/bedrock/span_utils.pypackages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/span_utils.py
A possible fix is to migrate the remaining runtime and test references to GenAIAttributes. Alternatively, compatibility aliases could be restored on SpanAttributes if backward compatibility is intended.
I searched the repository history and existing reports but did not find a later fix for these remaining references. I am willing to submit a PR.
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
- Ngôn ngữ chính
- Python
- Star
- 7.5k
- Fork
- 1.2k
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 traceloop/openllmetry
-
bug python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
traceloop/openllmetry#4717 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug Report: OpenAI instrumentation drops gen_ai.usage.reasoning_tokens on streamed chat completionsCó thể đã có người làm @jayfeng7 đã nhận 23 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
traceloop/openllmetry#4660 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Report: Failed dataset deletes still remove local rows and columnsCó thể đã có người làm @inchang-ing đã nhận 32 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
traceloop/openllmetry#4630 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug Report: LiteLLM instrumentation does not record seed, stop, frequency_penalty, presence_penaltyCó thể đã có người làm @shantam77 đã nhận 38 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
traceloop/openllmetry#4598 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug Report: LiteLLM instrumentation never ends the span when a call is interrupted (KeyboardInterrupt, asyncio cancellation)Có thể đã có người làm @rupak-eng đã nhận 39 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
traceloop/openllmetry#4597 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của traceloop/openllmetry
Issue tương tự
-
Internal ErrorĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
frappe/frappe_docker#2071 ·
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 82/100
The-Pocket/PocketFlow#161 ·
-
[Bug]: Webapp workspace fails to render in Safari — "Can't find variable: requestIdleCallback"Đang mởcomp/desktop P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#157702 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
scibench_physics / scibench_chemistry: a correct answer scores 0 when the unit has a power of tenCó thể đã có người làm @BahaaMattar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
EvolvingLMMs-Lab/lmms-eval#1699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
project_inputs.html uses undefined file variable for dropdown IDs, lacks visual tag badges, and has empty delete labelsCó thể đã có người làm @Rucha0901 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aboutcode-org/scancode.io#2354 ·
Maintainer thường phản hồi trong vòng 1 ngày