Skip to content

Conversation

@threddy
Copy link
Contributor

@threddy threddy commented Jan 16, 2026

Why?

  1. Clients can configure their own custom sources in Agent Framework. Also see this. Spans from custom sources do not flow through logic we have in AgentFrameworkSpanProcessor.
  2. Input and output messages for invoke_agent and chat spans follow the role + parts + content + type format.

What?

  1. Allow specifying custom sources. Usage
    builder.AddA365Tracing(config => { config.WithAgentFramework(additionalSources: "myCustomSource"); });
  2. Clean up input and output messages attribute to keep only the actual messages.

Testing
Before change
image
gen_ai.input.messages
gen_ai.output.messages

With change
image

@threddy threddy requested a review from a team as a code owner January 16, 2026 05:53
Copilot AI review requested due to automatic review settings January 16, 2026 05:53
Copy link
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

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 additionalSources parameter in WithAgentFramework()
  • 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

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.

3 participants