Skip to main content
Microsoft Agent Framework is Microsoft’s open-source SDK for building AI agents. Its C# SDK emits OpenTelemetry spans that follow the OpenTelemetry GenAI semantic conventions. Phoenix converts those spans to OpenInference when they arrive, so you only need the OpenTelemetry SDK and an OTLP exporter. No OpenInference package is required. See Translating semantic conventions.

Prerequisites

Launch Phoenix

No uv? pip install arize-phoenix && phoenix serve does the same thing. See Terminal setup for customization.
Phoenix serves its UI and OTLP HTTP on port 6006, and OTLP gRPC on port 4317. For a local instance that’s http://localhost:6006. Leave it running while you work.

Install

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

Setup

Set the Phoenix endpoint, the project name, and your OpenAI key:
Replace the contents of Program.cs with the code below. It configures an OTLP HTTP exporter that sends spans to <PHOENIX_COLLECTOR_ENDPOINT>/v1/traces, sets the Phoenix project with the openinference.project.name resource attribute, and builds one agent with a GetWeather function tool. GPT-6.1 Sol requires the Responses API for tool calling, so the agent uses GetResponsesClient().
EnableSensitiveData = true records prompts, responses, tool arguments, and tool results on the spans. Enable it only when you trust the trace destination. Set it to false to omit message content.
Program.cs
UseOpenTelemetry instruments the agent and emits spans for the agent invocation, each chat call, and each function execution. The tracer provider listens to the same source name passed to UseOpenTelemetry and exports those spans to Phoenix.

Add a tool

Create WeatherTools.cs for the function tool the agent calls:
WeatherTools.cs

Run Microsoft Agent Framework

Run the project from the MicrosoftAgentFramework directory:
You should see output like:

Observe

Open Phoenix and select the microsoft-agent-framework-csharp project. Each agent.RunAsync() call appears as one trace:

Troubleshooting

  • No traces in Phoenix. Confirm PHOENIX_COLLECTOR_ENDPOINT points at your Phoenix instance and is set in the same shell that runs dotnet run. The exporter appends /v1/traces to it. If authentication is enabled, set PHOENIX_API_KEY.
  • No agent spans. The source name passed to UseOpenTelemetry must match the source registered with .AddSource(sourceName).
  • Spans land in the default project. Confirm the openinference.project.name resource attribute is set.
  • Prompts or tool content are missing. Set EnableSensitiveData = true in the agent’s OpenTelemetry configuration.
  • 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.

Resources

Microsoft Agent Framework documentation

Microsoft Agent Framework observability

Microsoft Agent Framework on GitHub