Skip to content

Upgrade Agent Framework sample to Agent365 GA (1.0.0) with observability instrumentation#297

Open
sellakumaran wants to merge 1 commit intomainfrom
users/sellak/ga-update
Open

Upgrade Agent Framework sample to Agent365 GA (1.0.0) with observability instrumentation#297
sellakumaran wants to merge 1 commit intomainfrom
users/sellak/ga-update

Conversation

@sellakumaran
Copy link
Copy Markdown
Contributor

  • Upgraded Microsoft.Agents.A365.*, Microsoft.OpenTelemetry to GA 1.0.0 releases
  • Added end-to-end tracing with InvokeAgentScope (per turn) and ExecuteToolScope (per tool call)
  • Refactored DateTimeFunctionTool to instance class with DI for observability support
  • Migrated from AgentThread to AgentSession for conversation state management
  • Expanded appsettings.json with Agent365Observability config section; clarified Blueprint vs Agent Identity placeholders

…ity instrumentation

- Upgraded Microsoft.Agents.A365.*, Microsoft.OpenTelemetry, Azure.AI.OpenAI, and related packages to GA 1.0.0 releases
- Added end-to-end tracing with InvokeAgentScope (per turn) and ExecuteToolScope (per tool call)
- Refactored DateTimeFunctionTool to instance class with DI for observability support
- Migrated from AgentThread to AgentSession for conversation state management
- Expanded appsettings.json with Agent365Observability config section; clarified Blueprint vs Agent Identity placeholders
@sellakumaran sellakumaran requested a review from a team as a code owner May 1, 2026 23:19
Copilot AI review requested due to automatic review settings May 1, 2026 23:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 4 package(s) with unknown licenses.
See the Details below.

License Issues

dotnet/agent-framework/sample-agent/AgentFrameworkSampleAgent.csproj

PackageVersionLicenseIssue Type
Microsoft.Agents.A365.Notifications1.0.0NullUnknown License
Microsoft.Agents.A365.Tooling.Extensions.AgentFramework1.0.0NullUnknown License
Microsoft.Agents.AI1.1.0NullUnknown License
Microsoft.OpenTelemetry1.0.0NullUnknown License
Denied Licenses: GPL-3.0-only, AGPL-3.0-only

OpenSSF Scorecard

PackageVersionScoreDetails
nuget/Azure.AI.OpenAI 2.7.0-beta.2 🟢 7.2
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 5dependency not pinned by hash detected -- score normalized to 5
Fuzzing⚠️ 0project is not fuzzed
nuget/Azure.Identity 1.17.1 🟢 7.2
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 5dependency not pinned by hash detected -- score normalized to 5
Fuzzing⚠️ 0project is not fuzzed
nuget/Microsoft.Agents.A365.Notifications 1.0.0 UnknownUnknown
nuget/Microsoft.Agents.A365.Tooling.Extensions.AgentFramework 1.0.0 UnknownUnknown
nuget/Microsoft.Agents.AI 1.1.0 UnknownUnknown
nuget/Microsoft.Agents.Authentication.Msal 1.4.83 UnknownUnknown
nuget/Microsoft.Agents.Hosting.AspNetCore 1.4.83 UnknownUnknown
nuget/Microsoft.Extensions.AI.OpenAI 10.0.1-preview.1.25571.5 🟢 6.4
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 8Found 12/15 approved changesets -- score normalized to 8
Security-Policy🟢 10security policy file detected
Maintained🟢 1030 commit(s) and 20 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Binary-Artifacts🟢 10no binaries found in the repo
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Pinned-Dependencies🟢 9dependency not pinned by hash detected -- score normalized to 9
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
nuget/Microsoft.OpenTelemetry 1.0.0 UnknownUnknown

Scanned Files

  • dotnet/agent-framework/sample-agent/AgentFrameworkSampleAgent.csproj

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the .NET Agent Framework sample agent to Agent365 GA (1.0.0) packages and adds end-to-end observability/tracing around agent turns and tool invocations, while updating conversation state management to use AgentSession.

Changes:

  • Upgrade A365 + OpenTelemetry-related NuGet dependencies to 1.0.0 GA (and related compatible versions).
  • Add tracing scopes (InvokeAgentScope, ExecuteToolScope) for per-turn and per-tool instrumentation.
  • Migrate conversation state from AgentThread to AgentSession and adjust tool registration/DI usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
dotnet/agent-framework/sample-agent/appsettings.json Updates placeholders and adds Agent365 observability configuration settings.
dotnet/agent-framework/sample-agent/Tools/WeatherLookupTool.cs Adds per-tool execution tracing and response recording for weather tools.
dotnet/agent-framework/sample-agent/Tools/DateTimeFunctionTool.cs Refactors datetime tool to an instance class and adds tracing scope + response recording.
dotnet/agent-framework/sample-agent/Program.cs Updates OpenTelemetry wiring to capture custom AgentMetrics activity source.
dotnet/agent-framework/sample-agent/AgentFrameworkSampleAgent.csproj Updates package references to GA/stable versions (and related dependencies).
dotnet/agent-framework/sample-agent/Agent/MyAgent.cs Adds per-turn tracing, migrates to AgentSession, and updates chat options/history wiring.
Comments suppressed due to low confidence (1)

dotnet/agent-framework/sample-agent/Agent/MyAgent.cs:432

  • EnableSensitiveData = true will cause user inputs/outputs and tool data to be recorded into telemetry. This is risky for production and can contradict the goal of avoiding PII leaks. Make this opt-in (config/env gated) and default it to disabled outside local development.
                .AsBuilder()
                .UseOpenTelemetry(sourceName: AgentMetrics.SourceName, (cfg) => cfg.EnableSensitiveData = true)
                .Build();

Comment on lines +44 to +47
var toolCallDetails = new ToolCallDetails(
toolName: nameof(GetCurrentWeatherForLocation),
arguments: $"{{\"location\":\"{location}\",\"state\":\"{state}\"}}",
toolCallId: Guid.NewGuid().ToString(),
Comment on lines +33 to +35
// Register custom activity source so spans from AgentMetrics are captured by the TracerProvider
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => tracing.AddSource(AgentMetrics.SourceName));
Comment on lines +284 to +295
var collectedOutput = new System.Text.StringBuilder();
// Stream the response back to the user as we receive it from the agent.
await foreach (var response in _agent!.RunStreamingAsync(userText, thread, cancellationToken: cancellationToken))
{
if (response.Role == ChatRole.Assistant && !string.IsNullOrEmpty(response.Text))
{
turnContext?.StreamingResponse.QueueTextChunk(response.Text);
collectedOutput.Append(response.Text);
}
}
turnState.Conversation.SetValue("conversation.threadInfo", ProtocolJsonSerializer.ToJson(thread.Serialize()));
invokeScope.RecordOutputMessages(new[] { collectedOutput.ToString() });
var serializedSession = await _agent!.SerializeSessionAsync(thread!);
Comment on lines +270 to 272
// Read or Create the conversation session for this conversation.
AgentSession? thread = await GetConversationSessionAsync(_agent, turnState, cancellationToken);

Comment on lines +33 to +39
private AgentDetails BuildAgentDetails() =>
new AgentDetails(
agentId: configuration["Agent365Observability:AgentId"] ?? "local-dev",
agentName: configuration["Agent365Observability:AgentName"] ?? "my-agent",
agentDescription: configuration["Agent365Observability:AgentDescription"] ?? "",
agentBlueprintId: configuration["Agent365Observability:AgentBlueprintId"] ?? "",
tenantId: configuration["Agent365Observability:TenantId"] ?? "local-dev");
{
var toolCallDetails = new ToolCallDetails(
toolName: nameof(GetWeatherForecastForLocation),
arguments: $"{{\"location\":\"{location}\",\"state\":\"{state}\"}}",
Comment on lines +260 to +262
using var invokeScope = InvokeAgentScope.Start(
request: new Request(userText),
scopeDetails: new InvokeAgentScopeDetails(endpoint: new Uri("http://localhost:3978")),
},
"OpenWeatherApiKey": "----" //https://openweathermap.org/price - You will need to create a free account to get an API key (its at the bottom of the page).
}
"OpenWeatherApiKey": "----", //https://openweathermap.org/price - You will need to create a free account to get an API key (its at the bottom of the page).
"OpenWeatherApiKey": "----" //https://openweathermap.org/price - You will need to create a free account to get an API key (its at the bottom of the page).
}
"OpenWeatherApiKey": "----", //https://openweathermap.org/price - You will need to create a free account to get an API key (its at the bottom of the page).
"EnableAgent365Exporter": true,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants