From ca732733d3a962e4b75a97d1ea51e0c99575906e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 07:39:16 +0000 Subject: [PATCH] Split OpenTelemetryAgent ctor to preserve original (innerAgent, sourceName) signature Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/a890c9a7-0b77-40ab-802c-dfbf09f8c260 Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> --- .../Microsoft.Agents.AI/OpenTelemetryAgent.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs index 5eac701958..35f4287514 100644 --- a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs @@ -40,6 +40,22 @@ public sealed class OpenTelemetryAgent : DelegatingAIAgent, IDisposable /// private readonly bool _autoWireChatClient; + /// Initializes a new instance of the class. + /// The underlying to be augmented with telemetry capabilities. + /// + /// An optional source name that will be used to identify telemetry data from this agent. + /// If not provided, a default source name will be used for telemetry identification. + /// + /// is . + /// + /// The constructor automatically extracts provider metadata from the inner agent and configures + /// telemetry collection according to OpenTelemetry semantic conventions for AI systems. + /// + public OpenTelemetryAgent(AIAgent innerAgent, string? sourceName = null) + : this(innerAgent, sourceName, autoWireChatClient: true) + { + } + /// Initializes a new instance of the class. /// The underlying to be augmented with telemetry capabilities. /// @@ -47,7 +63,7 @@ public sealed class OpenTelemetryAgent : DelegatingAIAgent, IDisposable /// If not provided, a default source name will be used for telemetry identification. /// /// - /// When (the default) and the inner agent is a , the underlying + /// When and the inner agent is a , the underlying /// is automatically wrapped with for each invocation /// so that chat-level telemetry flows alongside agent-level telemetry. If the underlying chat client is already /// instrumented, no additional wrapping is applied. Set to to opt-out of this behavior. @@ -57,7 +73,7 @@ public sealed class OpenTelemetryAgent : DelegatingAIAgent, IDisposable /// The constructor automatically extracts provider metadata from the inner agent and configures /// telemetry collection according to OpenTelemetry semantic conventions for AI systems. /// - public OpenTelemetryAgent(AIAgent innerAgent, string? sourceName = null, bool autoWireChatClient = true) : base(innerAgent) + public OpenTelemetryAgent(AIAgent innerAgent, string? sourceName, bool autoWireChatClient) : base(innerAgent) { this._providerName = innerAgent.GetService()?.ProviderName; this._sourceName = sourceName;