Skip to content

Tasks#75

Merged
nikhilNava merged 7 commits intomainfrom
nikhilc/tasks
Nov 25, 2025
Merged

Tasks#75
nikhilNava merged 7 commits intomainfrom
nikhilc/tasks

Conversation

@nikhilNava
Copy link
Contributor

Tasks

  1. Introduce client IP address tracking
  2. Introduce size limit on span

@nikhilNava nikhilNava requested a review from a team as a code owner November 25, 2025 17:19
Copilot AI review requested due to automatic review settings November 25, 2025 17:19
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 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.

@nikhilNava nikhilNava merged commit 4592dc0 into main Nov 25, 2025
8 checks passed
@nikhilNava nikhilNava deleted the nikhilc/tasks branch November 25, 2025 19:33
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