Skip to main content
Microsoft Agent Framework is Microsoft’s open-source SDK for building AI agents. Its C# SDK emits OpenTelemetry spans using GenAI semantic conventions. Arize AX ingests these spans directly and displays agent, model, and tool activity without an OpenInference processor.

Prerequisites

Launch Arize AX

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Create a console project and add the Microsoft Agent Framework OpenAI connector and the OpenTelemetry Protocol exporter:

Configure credentials

Setup tracing

The example configures an OTLP gRPC exporter for Arize AX, adds the project name as a resource attribute, and instruments one agent with a GetWeather function tool. GPT-6.1 Sol requires the Responses API for tool calling, so the agent uses GetResponsesClient() (OpenAI model documentation).
EnableSensitiveData = true records prompts, responses, tool arguments, and tool results. Use it only when that data is appropriate for your Arize AX project and its retention policy. Set it to false to omit message content.
The agent instrumentation emits the agent invocation, chat client, and function execution spans. The tracer provider listens to the same source name passed to UseOpenTelemetry and exports those spans directly to Arize AX.

Add a tool

Create WeatherTools.cs for the function tool used by the agent:

Run Microsoft Agent Framework

Add the agent invocation to the end of Program.cs:
Run the project from the MicrosoftAgentFramework directory:

Expected output

Verify in Arize AX

  1. Open your Arize AX space and select project microsoft-agent-framework-csharp-example.
  2. You should see a trace with an invoke_agent root span, chat spans for the model calls, and an execute_tool span for GetWeather. The model spans include provider, model, token usage, and message attributes.
  3. If no traces appear, see Troubleshooting.
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.
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_ID and ARIZE_API_KEY are set in the same shell that runs dotnet run, and confirm the exporter endpoint and headers match the example.
  • No agent spans. The source name passed to UseOpenTelemetry must match the source registered with .AddSource(sourceName).
  • Wrong project. Confirm the openinference.project.name resource attribute is set to the value of ARIZE_PROJECT_NAME.
  • Prompts or tool content are missing. Set EnableSensitiveData = true for the agent’s OpenTelemetry configuration. This also records those values in traces, so enable it only when appropriate.
  • 401 from OpenAI. Verify OPENAI_API_KEY is valid and can access gpt-6.1-sol. Replace the model with one available to your account if needed.
  • Package restore or build fails. Confirm the .NET 10 SDK is installed and that the package versions in the project file match the versions shown above.

Resources

Microsoft Agent Framework Documentation

Microsoft Agent Framework Observability

Microsoft Agent Framework GitHub