openinference-instrumentation-agent-framework span processor reshapes them into the OpenInference format Arize AX expects.
This example is pinned to
agent-framework-openai==1.14.4. Microsoft Agent Framework evolves quickly; if a newer release changes the API, fix the version with pip install "agent-framework-openai==1.14.4".Prerequisites
- Python 3.10+
- An Arize AX account (sign up)
- An
OPENAI_API_KEYfrom the OpenAI Platform
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
Instrument Agent Framework with the
openinference-instrumentation-agent-framework processor, regardless of model provider (OpenAI, Anthropic, Azure). Agent Framework’s own instrumentation is on by default; enable_sensitive_telemetry() adds prompts, responses, and tool arguments to the spans. Do not use a provider instrumentor such as AnthropicInstrumentor or OpenAIInstrumentor — Agent Framework drives the model through its own client layer and emits its own OpenTelemetry spans, so a provider instrumentor captures no traces. The example below uses the OpenAI client, but the same setup applies to agent-framework-anthropic and every other connector.Run Microsoft Agent Framework
Expected output
Verify in Arize AX
- Open your Arize AX space and select project
microsoft-agent-framework-tracing-example. - You should see a new trace within ~30 seconds containing an
invoke_agentagent span (emitted by Agent Framework, reshaped by the OpenInference processor) wrapping achatLLM child span. The agent span’s input is the question and its output is the answer. - Open the LLM span. Its input messages start with the system prompt (
You are a concise factual assistant.) followed by the user question, and the span has the response and token usage attached. - 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. Confirm
ARIZE_SPACE_IDandARIZE_API_KEYare set in the same shell that runsexample.py. Enable OpenTelemetry debug logs withexport OTEL_LOG_LEVEL=debugand re-run. - Code ran but no spans appear. Import
instrumentationbefore anything fromagent_framework, so the tracer provider is set before Agent Framework creates spans. Also check thatENABLE_INSTRUMENTATIONisn’t set tofalsein your environment. - Spans missing inputs, outputs, or message content. Call
enable_sensitive_telemetry()fromagent_framework.observability. Without it, Agent Framework strips prompts, responses, and tool arguments from the spans. 401from OpenAI. VerifyOPENAI_API_KEYis set and has access togpt-5.5. Swap for a model your key can call.- API breaking changes. Microsoft Agent Framework evolves quickly; pin
agent-framework-openai==1.14.4if a newer release breaks the example. pip installfails withresolution-too-deep. You installed theagent-frameworkmeta-package, which drags in every provider connector viaagent-framework-core[all]. Install just the connector you need —agent-framework-openaifor this example.- Other LLM providers. Install that provider’s connector package and swap the chat client —
agent-framework-anthropic,agent-framework-gemini,agent-framework-bedrock,agent-framework-mistral,agent-framework-ollama, oragent-framework-foundry(FoundryChatClient) for Azure AI Foundry. The tracing setup above is unchanged for every one of them; see the framework docs for each client’s constructor and environment variables.