Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces two key features to the observability framework: client IP address tracking and span size limiting to prevent oversized telemetry data.
- Client IP tracking for both regular callers and agent-to-agent scenarios with automatic IPv4/IPv6 validation and normalization
- Span size limitation (250KB) with intelligent attribute truncation that prioritizes removing largest attributes first
- Reorganization of trace processor attributes to distinguish between common and invoke-agent-specific contexts
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
tests/observability/core/test_utils.py |
New test file validating IP address normalization for IPv4/IPv6 and edge cases |
tests/observability/core/test_invoke_agent_scope.py |
Added constant imports and test for caller agent client IP attribute propagation |
tests/observability/core/test_baggage_builder.py |
Added tests for caller_client_ip method with IPv4/IPv6 validation scenarios |
tests/observability/core/exporters/test_utils.py |
New test file validating span truncation logic for various span sizes |
libraries/.../core/utils.py |
Added validate_and_normalize_ip utility function for IP validation using ipaddress module |
libraries/.../core/trace_processor/util.py |
Moved execution source attributes to COMMON_ATTRIBUTES and added caller client IP |
libraries/.../middleware/baggage_builder.py |
Added caller_client_ip method with IP validation, removed deprecated source_metadata_id method |
libraries/.../core/invoke_agent_scope.py |
Added client IP validation and span attribute setting for agent-to-agent callers |
libraries/.../exporters/utils.py |
Implemented truncate_span_if_needed function with 250KB size limit and largest-first truncation |
libraries/.../exporters/agent365_exporter.py |
Integrated span truncation into the _map_span method |
libraries/.../core/constants.py |
Added GEN_AI_CALLER_CLIENT_IP_KEY and GEN_AI_CALLER_AGENT_USER_CLIENT_IP constants |
libraries/.../core/agent_details.py |
Added agent_client_ip field and updated docstrings for clarity |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
Show resolved
Hide resolved
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
Show resolved
Hide resolved
...s/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/utils.py
Show resolved
Hide resolved
...65-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py
Show resolved
Hide resolved
...oft-agents-a365-observability-core/microsoft_agents_a365/observability/core/agent_details.py
Show resolved
Hide resolved
...gents-a365-observability-core/microsoft_agents_a365/observability/core/invoke_agent_scope.py
Show resolved
Hide resolved
juliomenendez
requested changes
Nov 25, 2025
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
Outdated
Show resolved
Hide resolved
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
Outdated
Show resolved
Hide resolved
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
Show resolved
Hide resolved
juliomenendez
approved these changes
Nov 25, 2025
threddy
approved these changes
Nov 25, 2025
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.
Tasks