Uh oh!
There was an error while loading. Please reload this page.
.NET: Update OpenTelemetry Agent - Added Demo, AIAgentMetadata and Agent.GetService() - #356
Conversation
…nto demos/open-telemetry-agent
…nto demos/open-telemetry-agent
There was a problem hiding this comment.
Pull Request Overview
This PR updates the OpenTelemetry Agent implementation with expanded support and behavior, including a new demo sample, AIAgentMetadata for agent-specific metadata retrieval, and Agent.GetService() method similar to MEAI's IChatClient. The update also adds logging support with deduplication prevention and reorganizes solution folders.
- Added comprehensive OpenTelemetry Agent demo with Aspire Dashboard integration
- Introduced
AIAgentMetadataandAgent.GetService()method for retrieving agent metadata and services - Enhanced OpenTelemetry logging with deduplication logic when agents already have OTEL-enabled chat clients
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| OpenTelemetryAgent.cs | Enhanced with logging support, metadata handling, and deduplication logic |
| OpenTelemetryConsts.cs | New constants file replacing AgentOpenTelemetryConsts with updated naming |
| AIAgent.cs | Added abstract GetService method and generic helper |
| AIAgentMetadata.cs | New metadata class for agent provider information |
| ChatClientAgent.cs | Implemented GetService method with metadata support |
| AgentOpenTelemetry demo | Complete demo application with Aspire Dashboard integration |
| Test files | Updated to use new constants and test new GetService functionality |
Comments suppressed due to low confidence (1)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ent.GetService() (microsoft#356) * OTEL Demo * updating telemetry sample * OTEL updates * WIP * Adding GetService and Agent Metadata for Telemetry * WIP * Add UT for OTEL System behavior * Address Unicode problem * Add logging * Adjust for new extensions * Change Logger to LoggerFactory for the extension method * Address AI Feedback * Simplify script and readme just for Azure OpenAI * Increase code converage * Address merge conflict * Another slnx fix * Address PR comments * Address PR feedback + Add UT * Added Hosting UT to the solution * Address PR comments * Address missing sensitivity tests * Remove unecessary override * Address PR comments
…ent.GetService() (microsoft#356) * OTEL Demo * updating telemetry sample * OTEL updates * WIP * Adding GetService and Agent Metadata for Telemetry * WIP * Add UT for OTEL System behavior * Address Unicode problem * Add logging * Adjust for new extensions * Change Logger to LoggerFactory for the extension method * Address AI Feedback * Simplify script and readme just for Azure OpenAI * Increase code converage * Address merge conflict * Another slnx fix * Address PR comments * Address PR feedback + Add UT * Added Hosting UT to the solution * Address PR comments * Address missing sensitivity tests * Remove unecessary override * Address PR comments
Motivation and Context
This is a second round on the Agent OpenTelemetry implementation expanding the support and behavior of the current implementation.
genai.system, there was no option in agents to identify the system and as part of this current limitation I did introduceAIAgentMetadataandAgent.GetService()similar manner as found in MEAI's IChatClient to retrieve Agent specific metadata for OTEL and potentially more usages.Logingsupport for OpenTelemetryAgent with proper duplication prevention (if the agent has a chatclient with OTEL already enabled and logging)