Bug: Streaming responses don't capture `response_id` or `model_version`

オープン 初心者向け
#5,812 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
observability

調査の方向性

sentry_sdk/integrations/google_genai/streaming.py の accumulate_streaming_response() から始め、次に utils.py:886-890 のレスポンスメタデータの処理と比較してください。各ストリーミングチャンクに response_id と model_version があるか確認し、ストリーミングレスポンスで両方の span フィールドが設定されることを検証するテストを追加してください。

索引モデルが issue の本文から書いたものです。

説明

Bug Python Spans

Problem

In streaming.py, the accumulate_streaming_response() function initializes response_id and model to None (lines 53-54) but never populates them from the streaming chunks. The accumulation loop (lines 56-83) never reads chunk.response_id or chunk.model_version.

This means streaming responses will always have null for gen_ai.response.id and gen_ai.response.model.

The non-streaming path correctly captures both in utils.py:886-890:

if getattr(response, "response_id", None):
    span.set_data(SPANDATA.GEN_AI_RESPONSE_ID, response.response_id)
if getattr(response, "model_version", None):
    span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, response.model_version)

Files

  • sentry_sdk/integrations/google_genai/streaming.pyaccumulate_streaming_response()

Acceptance Criteria

  • Streaming chunks are checked for response_id and model_version
  • gen_ai.response.id and gen_ai.response.model are populated on streaming spans
  • Test added to verify streaming responses capture these fields
主要言語
Python
スター
2.2k
フォーク
672
平均マージ
1日 13分
マージ済み PR(30日)
212

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-python のほかの issue

getsentry/sentry-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。