Quick Start
What Gets Traced
The AutoGen AgentChat instrumentor captures:- Agent runs - Every
agent.run()and team.run()call with inputs and outputs - LLM calls - Model requests via
OpenAIChatCompletionClient.createwith messages, responses, and token usage - Tool executions - Each tool call with arguments and results
- Agent handoffs - Delegation between agents in Swarm and SelectorGroupChat teams
Example 1: Single Agent with Tools
A single agent handling customer support queries with tool calls and multi-turn conversation history.Example 2: Multi-Agent Swarm with Handoffs
A Swarm team where a triage agent delegates to specialists. Handoffs are automatically traced.Example 3: SelectorGroupChat
A team where a model selects the best agent to speak next, useful for complex queries requiring multiple specialists.Example 4: @trace Decorator for Custom Logic
Use the @trace decorator to create parent spans that wrap agent calls with your own business logic. This groups the agent invocation and any surrounding processing into a single span visible in HoneyHive.
escalation_workflow span appears as a parent containing the agent run, LLM calls, and tool calls nested underneath.
Troubleshooting
Traces not appearing
- Ensure
HoneyHiveTracer.init(...)is called beforeinstrumentor.instrument(...). - Pass
tracer_provider=tracer.providertoinstrument()so AutoGen uses HoneyHive’s tracer provider. - Ensure
HH_API_KEYandOPENAI_API_KEYare set. - Call
tracer.force_flush()before your process exits to ensure all spans are exported.
Only seeing OpenAI spans, not agent spans
Make sure you’re usingopeninference-instrumentation-autogen-agentchat (not openinference-instrumentation-openai). The AutoGen-specific instrumentor captures agent-level spans (agent names, handoffs, tool calls) in addition to underlying model calls.
Related
Enrich Traces
Add user IDs and custom metadata to your spans.
Custom Spans
Create spans for business logic around agent calls.
Distributed Tracing
Trace agents across service boundaries.
Query Trace Data
Export traces programmatically.

