Skip to content

Update schema attributes#208

Merged
nikhilNava merged 2 commits intomainfrom
nikhilc/updateAttributes
Mar 20, 2026
Merged

Update schema attributes#208
nikhilNava merged 2 commits intomainfrom
nikhilc/updateAttributes

Conversation

@nikhilNava
Copy link
Copy Markdown
Contributor

  1. Update caller schema attributes
  2. Rename sourcemetadata to channel

@nikhilNava nikhilNava requested review from a team as code owners March 20, 2026 17:58
Copilot AI review requested due to automatic review settings March 20, 2026 17:58
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

Updates observability schema attributes to align with the new caller/user and channel naming, replacing SourceMetadata with Channel across core + hosting and adjusting emitted attribute keys.

Changes:

  • Renames request “source metadata” to channel (SourceMetadataChannel) and updates span/baggage population accordingly.
  • Updates caller/agent identity attributes to use user.* and *.email keys instead of *.upn/microsoft.caller.*.
  • Updates tests and examples to reflect the new schema and helpers (get_channel_pairs, new constants).

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/usage_example.py Updates example usage from SourceMetadata to Channel and new request field name.
tests/observability/hosting/scope_helpers/test_scope_helper_utils.py Updates tests for new user constants and get_channel_pairs.
tests/observability/hosting/scope_helpers/test_populate_invoke_agent_scope.py Updates invoke scope population assertions to USER_ID_KEY.
tests/observability/hosting/scope_helpers/test_populate_baggage.py Updates baggage population assertions to USER_ID_KEY.
tests/observability/hosting/middleware/test_baggage_middleware.py Updates middleware baggage propagation tests to USER_ID_KEY.
tests/observability/core/test_invoke_agent_scope.py Updates core span assertions for Channel fields.
tests/observability/core/test_inference_scope.py Updates inference scope tests to use request.channel.
tests/observability/core/test_execute_tool_scope.py Updates execute tool scope tests to use request.channel.
tests/observability/core/test_baggage_builder.py Updates baggage builder tests to new keys; removes tests covering deprecated source_metadata_* methods.
libraries/microsoft-agents-a365-observability-hosting/.../scope_helpers/utils.py Renames and updates attribute pair helpers (get_channel_pairs, user keys, agent email key).
libraries/microsoft-agents-a365-observability-hosting/.../scope_helpers/populate_invoke_agent_scope.py Switches population from get_source_metadata_pairs to get_channel_pairs.
libraries/microsoft-agents-a365-observability-hosting/.../scope_helpers/populate_baggage.py Switches baggage population from get_source_metadata_pairs to get_channel_pairs.
libraries/microsoft-agents-a365-observability-hosting/.../middleware/output_logging_middleware.py Renames derived metadata helper to _derive_channel and emits new attribute keys.
libraries/microsoft-agents-a365-observability-core/.../trace_processor/util.py Updates filtered/processed attribute allowlist to match new constants.
libraries/microsoft-agents-a365-observability-core/.../source_metadata.py Removes SourceMetadata dataclass.
libraries/microsoft-agents-a365-observability-core/.../request.py Replaces source_metadata field with channel: Channel.
libraries/microsoft-agents-a365-observability-core/.../opentelemetry_scope.py Emits agent identity using new GEN_AI_AGENT_EMAIL_KEY.
libraries/microsoft-agents-a365-observability-core/.../middleware/baggage_builder.py Updates baggage keys to user/email constants; removes deprecated source_metadata_* methods.
libraries/microsoft-agents-a365-observability-core/.../invoke_agent_scope.py Updates request/caller tags to channel + user/email constants.
libraries/microsoft-agents-a365-observability-core/.../inference_scope.py Updates request tags to use request.channel.
libraries/microsoft-agents-a365-observability-core/.../execute_tool_scope.py Updates request tags to use request.channel.
libraries/microsoft-agents-a365-observability-core/.../constants.py Introduces USER_* constants and changes UPN keys to email keys.
libraries/microsoft-agents-a365-observability-core/.../channel.py Adds new Channel dataclass.
libraries/microsoft-agents-a365-observability-core/.../init.py Exports Channel instead of SourceMetadata.
Comments suppressed due to low confidence (1)

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/request.py:1

  • This is a breaking public API change: Request.source_metadata is removed and replaced with Request.channel. If backward compatibility is required, consider adding a deprecated source_metadata property (or constructor alias) that maps to channel, and potentially keep SourceMetadata as an alias of Channel for at least one deprecation cycle.
# Copyright (c) Microsoft Corporation.

@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

@nikhilNava nikhilNava enabled auto-merge (squash) March 20, 2026 19:25
@nikhilNava nikhilNava merged commit c9af672 into main Mar 20, 2026
13 checks passed
@nikhilNava nikhilNava deleted the nikhilc/updateAttributes branch March 20, 2026 19:29
nikhilNava pushed a commit to microsoft/Agent365-dotnet that referenced this pull request Mar 23, 2026
…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 added a commit to microsoft/Agent365-dotnet that referenced this pull request Mar 23, 2026
…ller constants to user.* namespace (#219)

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: Nikhil Chitlur Navakiran (from Dev Box) <nikhilc@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

5 participants