Skip to content

add support for gen_ai.caller.client.ip and gen_ai.agent.user.client.ip - #91

Merged
fpfp100 merged 4 commits into
mainfrom
users/pfean/ip
Dec 1, 2025
Merged

add support for gen_ai.caller.client.ip and gen_ai.agent.user.client.ip#91
fpfp100 merged 4 commits into
mainfrom
users/pfean/ip

Conversation

@fpfp100

@fpfp100 fpfp100 commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Adds support for two new fields, gen_ai.caller.client.ip and gen_ai.agent.user.client.ip, to capture and propagate the client IP addresses of the API caller and agent user throughout the agent pipeline.

@fpfp100
fpfp100 marked this pull request as ready for review December 1, 2025 20:45
@fpfp100
fpfp100 requested a review from a team as a code owner December 1, 2025 20:45
Copilot AI review requested due to automatic review settings December 1, 2025 20:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for capturing and propagating client IP addresses throughout the agent observability pipeline by introducing two new fields: gen_ai.caller.client.ip for API callers and gen_ai.agent.user.client.ip for agent users in agent-to-agent scenarios.

Key Changes:

  • Added callerClientIp to CallerDetails interface and agentClientIP to EnhancedAgentDetails interface for tracking client IP addresses
  • Extended OpenTelemetry constants, span processors, and baggage builder to support the new IP address fields
  • Added comprehensive test coverage for the new IP address tracking functionality

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/agents-a365-observability/src/tracing/constants.ts Added two new OpenTelemetry constants for caller and caller-agent client IP addresses
packages/agents-a365-observability/src/tracing/contracts.ts Extended CallerDetails and EnhancedAgentDetails interfaces with client IP fields
packages/agents-a365-observability/src/tracing/middleware/BaggageBuilder.ts Added callerClientIp method to support IP address propagation via baggage
packages/agents-a365-observability/src/tracing/scopes/InvokeAgentScope.ts Updated scope initialization to capture and set IP address tags from caller details
packages/agents-a365-observability/src/tracing/processors/util.ts Added new IP constants to INVOKE_AGENT_ATTRIBUTES for span attribute processing
tests/observability/core/scopes.test.ts Added test case to verify IP address tags are properly set for callers and caller agents
tests/observability/core/agent365-exporter.test.ts Extended exporter test to validate IP address attributes in exported spans
tests/observability/core/BaggageBuilder.test.ts Enhanced BaggageBuilder test to verify IP address baggage propagation

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread packages/agents-a365-observability/src/tracing/constants.ts Outdated
Comment thread packages/agents-a365-observability/src/tracing/constants.ts Outdated
Comment thread packages/agents-a365-observability/src/tracing/middleware/BaggageBuilder.ts Outdated
Comment thread tests/observability/core/scopes.test.ts Outdated
juliomenendez
juliomenendez previously approved these changes Dec 1, 2025
threddy
threddy previously approved these changes Dec 1, 2025
@fpfp100
fpfp100 enabled auto-merge (squash) December 1, 2025 22:22
@fpfp100
fpfp100 dismissed stale reviews from threddy and juliomenendez via f93670b December 1, 2025 22:24
@fpfp100
fpfp100 merged commit 22ca368 into main Dec 1, 2025
7 checks passed
@fpfp100
fpfp100 deleted the users/pfean/ip branch December 1, 2025 22:43
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