Skip to content

Add GenAI main-agent attribution processors#120

Open
rads-1996 wants to merge 3 commits intomicrosoft:mainfrom
rads-1996:add-genai-main-agent
Open

Add GenAI main-agent attribution processors#120
rads-1996 wants to merge 3 commits intomicrosoft:mainfrom
rads-1996:add-genai-main-agent

Conversation

@rads-1996
Copy link
Copy Markdown
Member

Add GenAI main-agent attribution processors to propagate microsoft.gen_ai.main_agent.* attributes in multi-agent systems. Implements spec.

Copilot AI review requested due to automatic review settings May 5, 2026 20:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/microsoft/opentelemetry/_constants.py
Comment thread src/microsoft/opentelemetry/_genai/main_agent/_processor.py Outdated
Comment thread src/microsoft/opentelemetry/_genai/main_agent/_processor.py Outdated
Comment thread src/microsoft/opentelemetry/_genai/main_agent/_processor.py
Comment thread src/microsoft/opentelemetry/_genai/main_agent/_processor.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants