Add GenAI main-agent attribution processors#120
Open
rads-1996 wants to merge 3 commits intomicrosoft:mainfrom
Open
Add GenAI main-agent attribution processors#120rads-1996 wants to merge 3 commits intomicrosoft:mainfrom
rads-1996 wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds GenAI “main-agent” attribution propagation so spans and logs carry microsoft.gen_ai.main_agent.* attributes throughout multi-agent traces, per the referenced spec.
Changes:
- Introduces span + log record processors to propagate main-agent attribution from parent spans and into log records.
- Wires the processors into the distro initialization so they run by default (unless tracing/logging disabled).
- Adds constants and unit tests covering propagation and lifecycle no-ops.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/microsoft/opentelemetry/_genai/main_agent/_processor.py |
Implements the span/log processors that propagate microsoft.gen_ai.main_agent.* attributes |
src/microsoft/opentelemetry/_genai/main_agent/__init__.py |
Exposes the new processors as a package API |
src/microsoft/opentelemetry/_distro.py |
Registers the processors by default in the distro configuration |
src/microsoft/opentelemetry/_constants.py |
Adds new microsoft.gen_ai.main_agent.* attribute key constants |
tests/genai/main_agent/test_span_processor.py |
Adds tests for span propagation and self-copy behavior |
tests/genai/main_agent/test_log_record_processor.py |
Adds tests for log record enrichment from current span |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Add GenAI main-agent attribution processors to propagate microsoft.gen_ai.main_agent.* attributes in multi-agent systems. Implements spec.