AI tracing: .NET AI
Any IChatClient (OpenAI, Azure OpenAI, Ollama and others) and Semantic Kernel or Agent Framework apps built on it.
1. Add the OpenTelemetry step to your chat client
UseOpenTelemetry creates a span for every chat call and tool call. EnableSensitiveData puts prompts and answers on the spans; leave it off to send counts and timings only.
IChatClient chat = new OpenAI.Chat.ChatClient("gpt-5", apiKey)
.AsIChatClient()
.AsBuilder()
.UseOpenTelemetry(sourceName: "MyApp.AI", configure: o => o.EnableSensitiveData = true)
.UseFunctionInvocation()
.Build();2. Listen to that source
Add the source name to the tracing your service already sends to PowerTraces.
builder.AddPowerTraces();
builder.Services.ConfigureOpenTelemetryTracerProvider(t => t.AddSource("MyApp.AI"));The same pipeline works for Azure OpenAI, Ollama and any other IChatClient. Keep UseOpenTelemetry before UseFunctionInvocation so each tool call becomes its own step.
Prompts and answers
Most libraries send only counts and timings until you turn content on. When you do, PowerTraces keeps it, masks personal data, or drops it, as set in AI › Settings for each workspace.
Check it works
Make one model call, then open the AI page: the run appears within a minute. Open it to see each step in the Agent tab.