🐛 Bug Report: OpenAI instrumentation drops gen_ai.input.messages on image requests when no uploader is configured
Maintainer thường phản hồi trong vòng 1 ngày
Đá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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- backend-api-design, observability
Hướng nghiên cứu
Start with openai/__init__.py:20-22 and shared/chat_wrappers.py:441,448; trace how the default uploader is checked and awaited, then inspect the existing tests for base64 image chat messages. Confirm that requests without an uploader still set gen_ai.input.messages with the image inline, and check the other instrumentor defaults mentioned in the issue. An open pull request already addresses this issue.
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?
OpenAI Instrumentation
📜 Description
The default upload_base64_image in OpenAIInstrumentor.__init__ is a sync lambda, lambda *args: "" (openai/__init__.py:20-22), but it is awaited in shared/chat_wrappers.py:441:
url = await Config.upload_base64_image(str(trace_id), str(span_id), image_name, base64_string)
Because the default is truthy, _set_prompts always goes into the image path (chat_wrappers.py:448). That raises TypeError: object str can't be used in 'await' expression, @dont_throw swallows it, and _set_input_messages never runs. So gen_ai.input.messages is missing on every chat request that contains a base64 image.
This hits anyone using the instrumentation without Traceloop.init() (zero-code opentelemetry-instrument, or OpenAIInstrumentor().instrument() directly), since only the SDK passes an async uploader.
👟 Reproduction steps
OpenAIInstrumentor().instrument()on a plainTracerProvider(no traceloop-sdk)- Call
client.chat.completions.create(...)with a message that has animage_urlpart with adata:image/png;base64,...URL
👍 Expected behavior
gen_ai.input.messages is set, with the image kept inline (or as a URI if an uploader is configured).
👎 Actual Behavior with Screenshots
The span has gen_ai.output.messages but no gen_ai.input.messages.
🤖 Python Version
3.12
📃 Provide any additional context for the Bug.
Workaround: OpenAIInstrumentor(upload_base64_image=None).instrument(). With None the image is kept inline as a blob part. Suggested fix: default to None, or make the default an async def. Also worth checking the anthropic, google-generativeai and vertexai defaults (None): anthropic then writes the raw base64 into span attributes (anthropic/span_utils.py:39-45), which can be very large.
- Ngôn ngữ chính
- Python
- Star
- 7.5k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 3
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 Report: OpenAI Responses: with_raw_response.create() raises when the body can't be parsed, though the uninstrumented call returnsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở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: Incomplete cache token migration after #4243 breaks Bedrock and Groq instrumentationCó thể đã có người làm @Quantum-Enigma-dot đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
traceloop/openllmetry#4665 · 1 bình luận ·
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
Tất cả issue của traceloop/openllmetry
Issue tương tự
-
CI flake: test-windows times out spawning Node in tests/test_antigravity_node_hooks.py (develop red)Đang mởarea/ci P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
benchmark
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
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 79/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
mozilla-ai/cq#601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bump Python to 3.14 or 3.15Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày