Add GenAI main-agent attribution processor#46700
Open
rads-1996 wants to merge 8 commits intoAzure:mainfrom
Open
Add GenAI main-agent attribution processor#46700rads-1996 wants to merge 8 commits intoAzure:mainfrom
rads-1996 wants to merge 8 commits intoAzure: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 new GenAI processors intended to propagate microsoft.gen_ai.main_agent.* attributes across spans and log records for multi-agent tracing scenarios.
Changes:
- Introduces a span processor that propagates main-agent attributes from parent spans and self-attributes
invoke_agentspans on end. - Introduces a log record processor that copies main-agent attributes from the current span onto emitted logs.
- Adds changelog and unit tests for the new propagation behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_gen_ai/_processor.py |
Adds the new GenAI span/log processors and attribute mapping logic. |
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_gen_ai_processor.py |
Adds unit tests covering the new processor behaviors. |
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_gen_ai/__init__.py |
Creates the new _gen_ai package. |
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md |
Documents the new GenAI main-agent attribution feature. |
Comments suppressed due to low confidence (1)
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_gen_ai_processor.py:1
- The new fallback branch that writes directly to
log_record.attributesis untested. The added tests only exercise the nestedlog_record.log_record.attributespath, so a regression in this compatibility branch would not be caught.
# Copyright (c) Microsoft Corporation. All rights reserved.
0eda3e3 to
85b8338
Compare
…n_ai.main_agent.* attributes in multi-agent systems
85b8338 to
96b0cfc
Compare
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.
Description
Add GenAI main-agent attribution processors to propagate
microsoft.gen_ai.main_agent.*attributes in multi-agent systems. Implements spec.Distro changes - #46703. The exporter needs to be released first.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines