Skip to content

Update schema attributes: rename SourceMetadata to Channel, #219

Merged
nikhilNava merged 1 commit intomainfrom
nikhilc/updateCallerSchema
Mar 23, 2026
Merged

Update schema attributes: rename SourceMetadata to Channel, #219
nikhilNava merged 1 commit intomainfrom
nikhilc/updateCallerSchema

Conversation

@nikhilNava
Copy link
Copy Markdown
Contributor

update caller constants to user.* namespace

  1. Rename SourceMetadata class to Channel with simplified properties (Name, Link)
  2. Update caller dimension constants:
    • CallerIdKey (microsoft.caller.id) -> UserIdKey (user.id)
    • CallerUpnKey (microsoft.caller.upn) -> UserEmailKey (user.email)
    • CallerNameKey (microsoft.caller.name) -> UserNameKey (user.name)
  3. Update agent UPN constants:
    • AgentUPNKey (microsoft.agent.user.upn) -> AgentEmailKey (microsoft.agent.user.email)
    • CallerAgentUPNKey (microsoft.a365.caller.agent.user.upn) -> CallerAgentEmailKey (microsoft.a365.caller.agent.user.email)
  4. Update all consumers: scopes, data builders, BaggageBuilder, ActivityProcessor, hosting extensions, middleware, ETW logger
  5. Update all tests to use new naming

…ller constants to user.* namespace

1. Rename SourceMetadata class to Channel with simplified properties (Name, Link)
2. Update caller dimension constants:
   - CallerIdKey (microsoft.caller.id) -> UserIdKey (user.id)
   - CallerUpnKey (microsoft.caller.upn) -> UserEmailKey (user.email)
   - CallerNameKey (microsoft.caller.name) -> UserNameKey (user.name)
3. Update agent UPN constants:
   - AgentUPNKey (microsoft.agent.user.upn) -> AgentEmailKey (microsoft.agent.user.email)
   - CallerAgentUPNKey (microsoft.a365.caller.agent.user.upn) -> CallerAgentEmailKey (microsoft.a365.caller.agent.user.email)
4. Update all consumers: scopes, data builders, BaggageBuilder, ActivityProcessor, hosting extensions, middleware, ETW logger
5. Update all tests to use new naming

Port of microsoft/Agent365-python#208

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nikhilNava nikhilNava requested a review from a team as a code owner March 23, 2026 13:26
Copilot AI review requested due to automatic review settings March 23, 2026 13:26
@github-actions
Copy link
Copy Markdown

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

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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

Renames and reshapes observability schema attributes across the runtime/hosting stacks, aligning “caller” dimensions to OTel user.* attributes and replacing SourceMetadata with a simplified Channel contract.

Changes:

  • Replaced SourceMetadata with Channel (name/link) in tracing contracts, scopes, DTO builders, ETW logger APIs, and hosting middleware/extensions.
  • Renamed schema attribute keys for caller and agent identity (microsoft.caller.*user.*, microsoft.agent.user.upnmicrosoft.agent.user.email, etc.) and updated processors/builders accordingly.
  • Updated unit + integration tests to validate new attribute names and payload shapes.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Observability/Runtime/Tracing/Contracts/Request.cs Replaces SourceMetadata with Channel and updates request contract accordingly.
src/Observability/Runtime/Tracing/Scopes/OpenTelemetryConstants.cs Renames constants to user.* + agent/caller-agent email keys.
src/Observability/Runtime/Tracing/Scopes/OpenTelemetryScope.cs Emits channel + user.* + agent email tags under new keys.
src/Observability/Runtime/Tracing/Scopes/InvokeAgentScope.cs Switches request origin tag propagation to Channel and caller-agent email key.
src/Observability/Runtime/Tracing/Scopes/InferenceScope.cs Updates scope API/implementation to accept Channel.
src/Observability/Runtime/Tracing/Scopes/ExecuteToolScope.cs Updates scope API/implementation to accept Channel.
src/Observability/Runtime/Tracing/Scopes/OutputScope.cs Updates scope API/implementation to accept Channel.
src/Observability/Runtime/Tracing/Processors/ActivityProcessor.cs Updates allowlisted attribute keys to new agent email + user.* constants.
src/Observability/Runtime/DTOs/Builders/BaseDataBuilder.cs Renames attribute emission helpers to channel + user.* + agent email keys.
src/Observability/Runtime/DTOs/Builders/ExecuteInferenceDataBuilder.cs Switches builder inputs/attributes from source metadata to channel.
src/Observability/Runtime/DTOs/Builders/ExecuteToolDataBuilder.cs Switches builder inputs/attributes from source metadata to channel.
src/Observability/Runtime/DTOs/Builders/OutputDataBuilder.cs Switches builder inputs/attributes from source metadata to channel.
src/Observability/Runtime/Common/BaggageBuilder.cs Writes baggage under new keys (agent email, user.*).
src/Observability/Runtime/Etw/IA365EtwLogger.cs Updates ETW logger interface params/docs to Channel.
src/Observability/Runtime/Etw/A365EtwLogger.cs Propagates Channel through ETW logger implementation.
src/Observability/Hosting/Middleware/OutputLoggingMiddleware.cs Derives Channel from turn context and passes it into OutputScope.
src/Observability/Hosting/Extensions/TurnContextExtensions.cs Renames “source metadata” baggage helpers to “channel” helpers and updates keys.
src/Observability/Hosting/Extensions/BaggageBuilderExtensions.cs Updates extensions to set channel baggage via renamed helpers.
src/Observability/Hosting/Extensions/InvokeAgentScopeExtensions.cs Updates extensions to record channel tags via renamed helpers.
src/Tests/.../Tracing/Scopes/OutputScopeTest.cs Updates scope tests to validate channel + user.* tags.
src/Tests/.../Tracing/Scopes/InferenceScopeTest.cs Updates scope tests to validate channel + user.* tags.
src/Tests/.../Tracing/Scopes/ExecuteToolScopeTest.cs Updates scope tests to validate channel + user.* tags.
src/Tests/.../DTOs/Builders/*.cs Updates builder tests for channel + new key names (agent email, user.*).
src/Tests/.../Etw/EtwLoggingBuilderTests.cs Updates ETW payload tests for new caller keys and channel parameter naming.
src/Tests/.../Etw/EtwLoggerTests.cs Updates ETW logger usage to pass channel:.
src/Tests/...IntegrationTests/Agent365Exporter*E2ETests.cs Updates end-to-end payload assertions to user.* and new agent email key.
src/Tests/...Hosting.Tests/Middleware/BaggageTurnMiddlewareTests.cs Updates baggage assertions to user.id.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@nikhilNava I've opened a new pull request, #220, to work on those changes. Once the pull request is ready, I'll request review from you.

@nikhilNava nikhilNava enabled auto-merge (squash) March 23, 2026 15:42
@nikhilNava nikhilNava merged commit 7710de3 into main Mar 23, 2026
11 checks passed
@nikhilNava nikhilNava deleted the nikhilc/updateCallerSchema branch March 23, 2026 18:07
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.

6 participants