Skip to main content
Version: latest

agrag.agents.tracing

Per-run OpenInference tracing for agent runs.

build_agent takes an optional OpenTelemetry Tracer. Each ainvoke passes a fresh OpenInference callback built from it, so no global tracer provider or instrumentation is installed. The run's tool and model calls appear in one trace under the run.

Functions:

  • require_tracing – Raise a typed error when tracing dependencies are unavailable.
  • run_callbacks – Return the callbacks for one agent run.
  • tool_span_context – Return a context in which the running tool's OpenInference span is current.