Add parent_id support to ExecuteToolScope and InferenceScope#177
Merged
nikhilNava merged 2 commits intomainfrom Feb 11, 2026
Merged
Add parent_id support to ExecuteToolScope and InferenceScope#177nikhilNava merged 2 commits intomainfrom
nikhilNava merged 2 commits intomainfrom
Conversation
…rent span linking Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support to set parent Id on execute tools and inference spans
Add parent_id support to ExecuteToolScope and InferenceScope
Feb 11, 2026
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
Pull request overview
Extends existing W3C Trace Context parent span linking to ExecuteToolScope and InferenceScope by adding an optional parent_id parameter and propagating it into OpenTelemetryScope so spans can be created under an upstream parent context.
Changes:
- Added optional
parent_idargument toExecuteToolScope.start()/__init__()and passed it toOpenTelemetryScope. - Added optional
parent_idargument toInferenceScope.start()/__init__()and passed it toOpenTelemetryScope. - Added unit tests asserting spans inherit the parent trace/span IDs when
parent_idis provided.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/observability/core/test_inference_scope.py | Adds a unit test validating parent linking behavior for InferenceScope. |
| tests/observability/core/test_execute_tool_scope.py | Adds a unit test validating parent linking behavior for ExecuteToolScope. |
| libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_scope.py | Plumbs parent_id through InferenceScope creation into the base OTel scope. |
| libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/execute_tool_scope.py | Plumbs parent_id through ExecuteToolScope creation into the base OTel scope. |
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_scope.py
Show resolved
Hide resolved
...gents-a365-observability-core/microsoft_agents_a365/observability/core/execute_tool_scope.py
Show resolved
Hide resolved
...gents-a365-observability-core/microsoft_agents_a365/observability/core/execute_tool_scope.py
Show resolved
Hide resolved
...t-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_scope.py
Show resolved
Hide resolved
threddy
approved these changes
Feb 11, 2026
juliomenendez
approved these changes
Feb 11, 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.
Extends parent span linking (from #164) to
ExecuteToolScopeandInferenceScope, enabling W3C Trace Context linking for tool execution and inference spans.Changes
parent_idparameter tostart()and__init__()parent_idparameter tostart()and__init__()parent_idto base classOpenTelemetryScopefor context propagationUsage
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/core/ -v --tb=short -m not integration(dns block)/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/ -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/core/ -v --tb=short -m not integration(dns block)/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/ -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:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.