wrap_agent.
Required
Create steps withstart_as_current_span inside the wrapped run:
Optional step data
Add attributes for model, tokens, cost, and finish reason:instrument_openai() or instrument_anthropic(), many step attributes are emitted automatically.
Mark a step as failed
Dashboard outcome
Each step appears nested under the run so you can inspect:- per-call latency
- model and token usage
- finish reason
- where failures occurred in the reasoning chain
Next Steps
- Tool call usage
- Advanced for streaming and multi-destination patterns

