🐛 Bug Report: OpenAI instrumentation drops gen_ai.input.messages on image requests when no uploader is configured
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 7.5k
- フォーク
- 1.2k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
traceloop/openllmetry のほかの issue
-
🐛 Bug Report: OpenAI Responses: with_raw_response.create() raises when the body can't be parsed, though the uninstrumented call returns対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug python
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
traceloop/openllmetry#4717 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Bug Report: Incomplete cache token migration after #4243 breaks Bedrock and Groq instrumentation対応中かも @Quantum-Enigma-dot が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
traceloop/openllmetry#4665 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Bug Report: OpenAI instrumentation drops gen_ai.usage.reasoning_tokens on streamed chat completions対応中かも @jayfeng7 が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
traceloop/openllmetry#4660 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug Report: Failed dataset deletes still remove local rows and columns対応中かも @inchang-ing が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
traceloop/openllmetry#4630 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Bug Report: LiteLLM instrumentation does not record seed, stop, frequency_penalty, presence_penalty対応中かも @shantam77 が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
traceloop/openllmetry#4598 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
traceloop/openllmetry の issue をすべて見る
似ている issue
-
CI flake: test-windows times out spawning Node in tests/test_antigravity_node_hooks.py (develop red)オープンarea/ci P2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
benchmark
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mozilla-ai/cq#601 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信