Progress.Observability.Instrumentation
1.0.1
Prefix Reserved
See the version list below for details.
dotnet add package Progress.Observability.Instrumentation --version 1.0.1
NuGet\Install-Package Progress.Observability.Instrumentation -Version 1.0.1
<PackageReference Include="Progress.Observability.Instrumentation" Version="1.0.1" />
<PackageVersion Include="Progress.Observability.Instrumentation" Version="1.0.1" />
<PackageReference Include="Progress.Observability.Instrumentation" />
paket add Progress.Observability.Instrumentation --version 1.0.1
#r "nuget: Progress.Observability.Instrumentation, 1.0.1"
#:package Progress.Observability.Instrumentation@1.0.1
#addin nuget:?package=Progress.Observability.Instrumentation&version=1.0.1
#tool nuget:?package=Progress.Observability.Instrumentation&version=1.0.1
Progress Observability Instrumentation for .NET
AI agent telemetry for .NET applications built with IChatClient or IAgent from Microsoft AI libraries .
Installation
The NuGet package files are not yet available officially in the NuGet registry. This means that you need to manually add them to your project. There are several ways to do this:
- Add the package directly using the dotnet CLI command:
# copy the Progress.Observability.Instrumentation.X.X.X.nupkg package to a location of your choice - e.g. c:\packages
dotnet add <YourProject.csproj> package Progress.Observability.Instrumentation --source "c:\packages"
- Add the package using a local NuGet source:
# copy the Progress.Observability.Instrumentation.X.X.X.nupkg package to the location of your local source - e.g. c:\packages
# if you have not yet created the local source, you can do so by executing the following command
dotnet nuget add source c:\packages --name LocalFeed
# you can verify the source exists by executing
dotnet nuget list source
# finally add the package by executing the following command in your project directory
dotnet add package Progress.Observability.Instrumentation --source LocalFeed
Usage
- For Agents using IChatClient:
Call the .AddObservability() extension method of your IChatClient for LLM instrumentation.
And the .AddToolObservability() extension method of your ChatOptions instance for tool instrumentation.
Example using the Microsoft.Extensions.AI.OpenAI package:
using Microsoft.Extensions.AI;
using ModelContextProtocol.Client;
try
{
// ... Set up your chat client and MCP tools
IChatClient chatClient = new OpenAI.Chat.ChatClient("gpt-5-nano", openAIApiKey)
.AsIChatClient();
// Adding Progress Observability for LLM calls
chatClient = chatClient.AddObservability((options) => {
options.AppName = "Awesome Agent";
options.ApiKey = "ac_p_001_.....";
});
// Set up MCP client and tools
chatClient = new ChatClientBuilder(chatClient)
.UseFunctionInvocation()
.Build();
McpClient mcpClient = await McpClient.CreateAsync(
new HttpClientTransport(new()
{
Endpoint = new Uri("http://localhost:3001/sse"),
Name = "Weather MCP Server",
}));
IList<McpClientTool> tools = await mcpClient.ListToolsAsync();
ChatOptions options = new() { Tools = [..tools] };
// Adding Progress Observability for tool calls
options.AddToolObservability();
// ... Use the chat client with observability enabled
var response = await chatClient.GetResponseAsync("What is the weather like in Paris?", options);
}
finally
{
// Call the Shutdown() method before exiting your agent to flush any remaining data.
Progress.Observability.Extensions.AI.ObservabilityTracer.Shutdown();
}
- For Agents using IAgent:
Create a Progress Observability tracer and then use the .UseOpenTelemetry() method of the IAgentBuilder interface to instrument your agent.
using Progress.Observability.Extensions.AI;
try
{
var agentName = "Awesome AI Agent";
// Configure Progress Observability exporter with the default trace source "Progress.Observability.AgentMonitoring"
ObservabilityTracer.Initialize(new ObservabilityOptions()
{
AppName = agentName,
ApiKey = "ac_p_001_.....",
});
// Configure your tools. After that use .AddToolObservability() to instrument observability for tool calls
List<AITool> tools = [AIFunctionFactory.Create(AwesomeTool)];
// Create your agent
var aiAgent = new AzureOpenAIClient(new(endpoint),new AzureKeyCredential(azureApiKey))
.GetChatClient("gpt-4.1")
.AsAIAgent(instructions: "You are an assistant that helps users Microsoft .NET related trivia. Keep your answers concise and accurate. Use only text (no markdown).", name: agentName, tools: tools.AddToolObservability())
.AsBuilder()
// Configure the agent to use the Progress Observability exporter with the same trace source "Progress.Observability.AgentMonitoring"
.UseOpenTelemetry(sourceName: ObservabilityTracer.SourceName, configure: agent =>
{
// Enable this to include the content of inputs and outputs in the telemetry. Set to false if you don't want to send potentially sensitive data.
agent.EnableSensitiveData = true;
})
.Build();
// ... Use the agent
var response = aiAgent.RunAsync(message);
}
finally
{
// Call the Shutdown() method before exiting your agent to flush any remaining data.
ObservabilityTracer.Shutdown();
}
Configuration
There are two required properties that must be set to enable the observability instrumentation - AppName and ApiKey. Options can be set directly in code or using environment variables.
- Using the configure function in your code
chatClient = chatClient.AddObservability((options) =>
{
// (required) the Application name to be used in the observability dashboards
options.AppName = "Weather Agent";
// (required) your Progress Observability API key
options.ApiKey = "ac_p_001_.....";
// (optional) the OpenTelemetry endpoint where data will be sent.
options.Endpoint = "https://collector.observability.progress.com:443";
// (optional) for Extensions.AI agents: should LLM inputs be sent - default is true
options.RecordInputs = true;
// (optional) for Extensions.AI agents: should LLM responses be sent - default is true
options.RecordOutputs = true;
// (optional) enable debug logging - default is false
options.Debug = false;
});
- Using environment variables. In this case the configuration will be applied automatically when you instrument observability for your application.
$env:PROGRESS__OBSERVABILITY__APPNAME="Weather Agent"
$env:PROGRESS__OBSERVABILITY__APIKEY="ac_p_001_....."
# Optional
$env:PROGRESS__OBSERVABILITY__ENDPOINT="https://collector.observability.progress.com:443"
Shutdown
// call this method on application shutdown to flush any pending spans and traces. Using a try/catch block will ensure that you get telemetry even if the application crashes.
try {
// code to run the application here
}
finally {
Progress.Observability.Extensions.AI.ObservabilityTracer.Shutdown();
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.2.0)
- OpenTelemetry (>= 1.15.0)
- OpenTelemetry.Api (>= 1.15.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.0)
-
net8.0
- Microsoft.Extensions.AI.Abstractions (>= 10.2.0)
- OpenTelemetry (>= 1.15.0)
- OpenTelemetry.Api (>= 1.15.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.0)
-
net9.0
- Microsoft.Extensions.AI.Abstractions (>= 10.2.0)
- OpenTelemetry (>= 1.15.0)
- OpenTelemetry.Api (>= 1.15.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.