Bug: Streaming responses don't capture `response_id` or `model_version`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- observability
Direzione di ricerca
Inizia in sentry_sdk/integrations/google_genai/streaming.py, in accumulate_streaming_response(), quindi confronta la gestione dei metadati della risposta in utils.py:886-890. Controlla ogni chunk di streaming per response_id e model_version e aggiungi un test che verifichi che entrambi i campi dello span siano valorizzati per le risposte in streaming.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.py—accumulate_streaming_response()
Acceptance Criteria
- Streaming chunks are checked for
response_idandmodel_version gen_ai.response.idandgen_ai.response.modelare populated on streaming spans- Test added to verify streaming responses capture these fields
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 672
- Merge medio
- 1g 13m
- PR unite (30g)
- 212
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-python
-
Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-python#7543 · 1 commento ·
-
Python
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getsentry/sentry-python#6992 · 1 commento ·
-
Improvement Python
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
getsentry/sentry-python#6970 · 1 commento ·
-
Bug Python
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
getsentry/sentry-python#6504 · 1 commento ·
-
Improvement Python Spans
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-python#5833 · 1 commento ·
Tutte le issue di getsentry/sentry-python
Issue simili
-
documentation help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
simonw/sqlite-utils#872 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100