Skip to content

[bot] Add instrumentation for Azure.AI.Agents.Persistent (Azure AI Foundry Agents Service) #76

Description

@braintrust-bot

Summary

The Azure.AI.Agents.Persistent NuGet package (v1.1.0 stable, v1.2.0-beta.10 prerelease, ~2.2M total downloads) is Microsoft's official .NET client library for the Azure AI Foundry Agents Service — the production-ready stateful agent execution service built into Azure AI Foundry. It provides execution-oriented surfaces for running AI agents on conversation threads, streaming agent responses, and handling tool calls — none of which are instrumented in this SDK.

This package is distinct from every already-instrumented or already-filed package:

Azure.AI.Agents.Persistent is the package used in the official C# quickstart for executing agents: it owns the full run lifecycle (create thread → create run → poll status → retrieve messages).

Execution surfaces missing instrumentation

  • Run creation: RunsClient.CreateRun(threadId, agentId, ...) — submits a thread for execution against a configured agent, invoking the underlying LLM
  • Streaming runs: RunsClient.CreateRunStreamingAsync(threadId, agentId, ...) — streams StreamingUpdate events including ThreadRun, RunStep, and MessageDelta as the agent generates a response
  • Tool output submission: RunsClient.SubmitToolOutputsToRunAsync(threadId, runId, toolOutputs) — resumes a paused run after function/tool calls complete; the agent then continues generation
  • Streaming tool output: RunsClient.SubmitToolOutputsToStreamAsync(...) — streaming variant of tool output submission
  • Agent administration: AdministrationClient.CreateAgent(model, name, instructions, tools) — creates the agent configuration that drives model selection and system prompt

Braintrust docs status

not_found — The Braintrust Azure integration page documents only chat completion instrumentation via Braintrust.Sdk.AzureOpenAI and does not mention the Azure AI Foundry Agents Service or Azure.AI.Agents.Persistent. No C#-specific agent-run instrumentation is referenced anywhere in Braintrust docs.

Upstream sources

Local repo files inspected

  • src/Braintrust.Sdk.OpenAI/ — instruments OpenAI chat client only
  • src/Braintrust.Sdk.AzureOpenAI/ — instruments Azure.AI.OpenAI chat client only
  • src/Braintrust.Sdk.Anthropic/ — instruments Anthropic messages only
  • src/Braintrust.Sdk.AgentFramework/ — instruments Microsoft.Extensions.AI.IChatClient middleware only
  • Grep for Azure.AI.Agents, PersistentAgentsClient, RunsClient, CreateRun, and AgentsClient across the entire src/ tree returned zero results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions