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;