Merged
Conversation
Contributor
nikhilNava
commented
Mar 20, 2026
- Update caller schema attributes
- Rename sourcemetadata to channel
Contributor
There was a problem hiding this comment.
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(SourceMetadata→Channel) and updates span/baggage population accordingly. - Updates caller/agent identity attributes to use
user.*and*.emailkeys 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_metadatais removed and replaced withRequest.channel. If backward compatibility is required, consider adding a deprecatedsource_metadataproperty (or constructor alias) that maps tochannel, and potentially keepSourceMetadataas an alias ofChannelfor at least one deprecation cycle.
# Copyright (c) Microsoft Corporation.
...365-observability-hosting/microsoft_agents_a365/observability/hosting/scope_helpers/utils.py
Show resolved
Hide resolved
...ents-a365-observability-core/microsoft_agents_a365/observability/core/opentelemetry_scope.py
Show resolved
Hide resolved
...gents-a365-observability-core/microsoft_agents_a365/observability/core/invoke_agent_scope.py
Show resolved
Hide resolved
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
juliomenendez
approved these changes
Mar 20, 2026
fpfp100
approved these changes
Mar 20, 2026
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>
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.