This guide covers manual instrumentation. For quicker setup, use auto-instrumentation.
Setup
Install Braintrust and AgentScope:.env
Trace with AgentScope
Usesetup_agentscope() when you want to trace AgentScope explicitly.
trace-agentscope.py
setup_agentscope() initializes the Braintrust logger if one is not already active, then patches AgentScope.
What Braintrust traces
Braintrust creates spans for:- Agent runs: each agent invocation appears as a named task span
- Sequential pipelines: the pipeline run becomes a parent span, with child spans for each agent step
- Tool execution: tool calls appear as child tool spans under the active agent run
- Underlying model calls: LLM requests keep their normal model metadata, token metrics, and outputs
Supported versions
The integration is tested against AgentScope1.0.0 and the latest released version.