Python: Use executor_id and edge_group_id as span names for meaningful observability traces#2538
Merged
moonbox3 merged 5 commits intomicrosoft:mainfrom Dec 4, 2025
Merged
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves observability by changing span names from hardcoded constants to meaningful identifiers. Instead of using generic names like "executor.process" and "edge_group.process", the spans now use the actual executor_id and edge_group_id, making traces more readable when multiple executors or edge groups are involved.
Key changes:
- Executor processing spans now use
executor_idas the span name - Edge group processing spans now use
edge_group_id(with fallback toedge_group_type) as the span name - Tests updated to filter spans by attributes rather than hardcoded names
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| python/packages/core/agent_framework/observability.py | Modified create_processing_span to use executor_id as span name and create_edge_group_processing_span to use edge_group_id (or edge_group_type as fallback) |
| python/packages/core/tests/workflow/test_workflow_observability.py | Updated tests to filter spans by attributes and added verification that span names match executor_id |
| python/packages/core/tests/workflow/test_edge.py | Updated edge group tests to filter spans by attributes instead of hardcoded span names |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
dmytrostruk
approved these changes
Dec 2, 2025
moonbox3
commented
Dec 2, 2025
TaoChenOSU
reviewed
Dec 4, 2025
TaoChenOSU
approved these changes
Dec 4, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…l observability traces (microsoft#2538) * Use executor_id and edge_group_id as span names for meaningful observability traces * Update tests * Adjust naming
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.
Motivation and Context
Changes span names from hardcoded constants (
executor.process,edge_group.process) to use meaningful identifiers (executor_id,edge_group_id), making observability traces readable when multiple executors/edge groups are present in a workflow.Changes
create_processing_span: Usesexecutor_idas span name instead ofOtelAttr.EXECUTOR_PROCESS_SPANcreate_edge_group_processing_span: Usesedge_group_id(oredge_group_typeas fallback) as span name instead ofOtelAttr.EDGE_GROUP_PROCESS_SPANNot a breaking change. Span names are not part of the public API contract. All span attributes (
executor.id,executor.type,edge_group.type, etc.) remain unchanged, so existing trace consumers continue to work correctly with more meaningful span names.Description
Contribution Checklist