autogen API. The
AG2Instrumentor
captures ConversableAgent chats, replies, and tool execution as OpenInference
AGENT and TOOL spans in Arize AX.
Prerequisites
- Python 3.10+
- An Arize AX account (sign up)
Launch Arize AX
- Sign in to your Arize AX account.
- From Space Settings, copy your Space ID and API Key. You will set them as
ARIZE_SPACE_IDandARIZE_API_KEYbelow.
Install
Configure credentials
Setup tracing
autogen API. AG2 v1 uses a
different middleware API and is not yet supported.
Run AG2
Expected output
Verify in Arize AX
- Open your Arize AX space and select project
ag2-tracing-example. - You should see a new trace within ~30 seconds with AGENT spans for the chat and reply, plus a TOOL span named
get_weather. - If no traces appear, see Troubleshooting.
Check from the skill, CLI, or SDK
Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.- Arize skill (agent)
- AX CLI
- SDK
Install the Arize Skills plugin and let your coding agent check for you:Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.
Troubleshooting
- No traces in Arize AX. Call
AG2Instrumentor().instrument(...)before starting a chat. - Import or instrumentation error. Install an AG2 0.14.x release; AG2 v1 is not supported by this instrumentor.
- The example asks for an LLM key. Keep both agents’
llm_config=False; this offline example runs a local tool instead of calling a model.