Add gen_ai.caller.agent.type attribute for A2A tracing#161
Merged
nikhilNava merged 4 commits intomainfrom Feb 6, 2026
Merged
Conversation
…187) Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
…back Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement features from Node.js PR in Python
Add gen_ai.caller.agent.type attribute for A2A tracing
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Python equivalents of changes from Node.js PR #187, adding support for tracking the gen_ai.caller.agent.type attribute in agent-to-agent invocation traces using OpenTelemetry.
Changes:
- Added
GEN_AI_CALLER_AGENT_TYPE_KEYconstant to the list of invoke agent attributes for trace processing - Implemented agent type tag setting in the InvokeAgentScope to capture caller agent type during invocations
- Added comprehensive test coverage to verify the agent type attribute is properly set in telemetry spans
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/trace_processor/util.py |
Added GEN_AI_CALLER_AGENT_TYPE_KEY to the INVOKE_AGENT_ATTRIBUTES list for trace processing |
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/invoke_agent_scope.py |
Imported the constant and added logic to set the agent type tag from caller agent details, following the existing pattern for enum value handling |
tests/observability/core/test_invoke_agent_scope.py |
Added new test method and updated test fixture with agent type to verify the attribute is correctly captured in telemetry spans |
juliomenendez
approved these changes
Feb 5, 2026
fpfp100
approved these changes
Feb 5, 2026
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.
Ports Agent365-nodejs#187 to Python. Adds the
gen_ai.caller.agent.typeOpenTelemetry attribute to agent-to-agent invocation traces.Changes
GEN_AI_CALLER_AGENT_TYPE_KEYtoINVOKE_AGENT_ATTRIBUTESagent_typespan attribute fromcaller_agent_detailsUsage
The constant
GEN_AI_CALLER_AGENT_TYPE_KEYwas already defined inconstants.pybut wasn't being used.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
il-1234567812345678123456781234567.8.tenant.api.powerplatform.com/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/observability/ -v --tb=short -m not integration(dns block)il-testtenan.t.tenant.api.powerplatform.com/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/observability/ -v --tb=short -m not integration(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.