getsentry / getsentry/sentry-python

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

Aberta
#5,835 1 comentário 0 reações 0 responsáveis Ver no GitHub
Improvement Python Spans
Linguagem predominante
Python
Estrelas
2.2k
Forks
669
Merge médio
1d 1h
PRs com merge (30d)
213

Descrição

`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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.