add support for gen_ai.caller.client.ip and gen_ai.agent.user.client.ip - #91
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
callerClientIptoCallerDetailsinterface andagentClientIPtoEnhancedAgentDetailsinterface 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.
juliomenendez
previously approved these changes
Dec 1, 2025
threddy
previously approved these changes
Dec 1, 2025
fpfp100
enabled auto-merge (squash)
December 1, 2025 22:22
…5-nodejs into users/pfean/ip
threddy
approved these changes
Dec 1, 2025
juliomenendez
approved these changes
Dec 1, 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.
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.