Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enhances the Agent Framework observability extension to support custom activity sources and simplifies input/output message attributes by extracting only text content.
Changes:
- Adds support for custom activity sources via an optional
additionalSourcesparameter inWithAgentFramework() - Implements message filtering and text extraction logic to clean up gen_ai.input.messages and gen_ai.output.messages tags
- Introduces comprehensive test coverage for the new message processing functionality
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 27 comments.
Show a summary per file
| File | Description |
|---|---|
| Microsoft.Agents.A365.Observability.Extension.Tests.csproj | Adds project reference to AgentFramework extension for testing |
| AgentFrameworkSpanProcessorHelperTests.cs | New test file with comprehensive coverage for message filtering and text extraction |
| AgentFrameworkSpanProcessorHelper.cs | New helper class implementing message filtering logic to extract text content from user/assistant messages |
| AgentFrameworkMessageContent.cs | New model classes for deserializing Agent Framework message structure |
| Microsoft.Agents.A365.Observability.Extensions.AgentFramework.csproj | Adds InternalsVisibleTo for test project access |
| BuilderExtensions.cs | Updates WithAgentFramework to accept custom sources and updates copyright header format (inconsistent) |
| AgentFrameworkSpanProcessor.cs | Adds constructor parameter for custom sources and implements source filtering for invoke_agent, chat, and execute_tool operations |
src/Observability/Extensions/AgentFramework/Utils/AgentFrameworkSpanProcessorHelper.cs
Outdated
Show resolved
Hide resolved
src/Observability/Extensions/AgentFramework/Utils/AgentFrameworkSpanProcessorHelper.cs
Show resolved
Hide resolved
src/Observability/Extensions/AgentFramework/Utils/AgentFrameworkSpanProcessorHelper.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
...icrosoft.Agents.A365.Observability.Extension.Tests/AgentFrameworkSpanProcessorHelperTests.cs
Show resolved
Hide resolved
juliomenendez
approved these changes
Jan 16, 2026
nikhilNava
approved these changes
Jan 20, 2026
pontemonti
pushed a commit
that referenced
this pull request
Feb 5, 2026
Port from Node.js SDK PR #183 - adds x-ms-agentid header to all outbound HTTP requests to the MCP platform for agent identification. Header priority: 1. Agent Blueprint ID from TurnContext (agenticAppBlueprintId) 2. Agent Blueprint ID from token (xms_par_app_azp claim) 3. Entra Application ID from token (appid or azp claim) 4. Application name from entry assembly Changes: - Add GetAgentIdFromToken() and GetApplicationName() to Runtime Utility - Add AgentIdHeader constant to Tooling Constants - Update HttpContextHeadersHandler to add x-ms-agentid header - Pass authToken to HttpContextHeadersHandler for header resolution - Add InternalsVisibleTo for test access - Add comprehensive unit tests for new methods - Add PRD documentation
pontemonti
added a commit
that referenced
this pull request
Feb 5, 2026
Port from Node.js SDK PR #183 - adds x-ms-agentid header to all outbound HTTP requests to the MCP platform for agent identification. Header priority: 1. Agent Blueprint ID from TurnContext (agenticAppBlueprintId) 2. Agent Blueprint ID from token (xms_par_app_azp claim) 3. Entra Application ID from token (appid or azp claim) 4. Application name from entry assembly Changes: - Add GetAgentIdFromToken() and GetApplicationName() to Runtime Utility - Add AgentIdHeader constant to Tooling Constants - Update HttpContextHeadersHandler to add x-ms-agentid header - Pass authToken to HttpContextHeadersHandler for header resolution - Add InternalsVisibleTo for test access - Add comprehensive unit tests for new methods - Add PRD documentation Co-authored-by: Johan Broberg <johanb@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
What?
builder.AddA365Tracing(config => { config.WithAgentFramework(additionalSources: "myCustomSource"); });Testing

Before change
gen_ai.input.messages
gen_ai.output.messages
With change
