getsentry / getsentry/sentry-python

Instrument `Agent.iter()` with `invoke_agent` span

Abierto
#5,835 1 comentario 0 reacciones 0 asignados Ver en GitHub
Improvement Python Spans
Lenguaje dominante
Python
Estrellas
2.2k
Forks
669
Merge medio
1 d 1 h
PR fusionados (30 d)
213

Descripción

`Agent.iter()` is a public API for step-by-step agent iteration that does NOT call `Agent.run()`, so currently no `invoke_agent` span is created. Inner model calls still get `gen_ai.chat` spans via the `ModelRequestNode` patch, but without the parent agent span.

This should be patched similarly to `Agent.run_stream()` — wrapping the async context manager to create an `invoke_agent` span and push/pop the agent context.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.