Align telemetry with OpenTelemetry MCP semantic conventions (#1139)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-01-13 18:07:49 -08:00 • committed by GitHub
commit d52a7b183d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -187,6 +187,9 @@ internal sealed partial class McpClientImpl : McpClient
_negotiatedProtocolVersion = initializeResponse.ProtocolVersion;
// Update session handler with the negotiated protocol version for telemetry
_sessionHandler.NegotiatedProtocolVersion = _negotiatedProtocolVersion;
// Send initialized notification
await this.SendNotificationAsync(
NotificationMethods.InitializedNotification,
@ -230,6 +233,9 @@ internal sealed partial class McpClientImpl : McpClient
?? _options.ProtocolVersion
?? McpSessionHandler.LatestProtocolVersion;
// Update session handler with the negotiated protocol version for telemetry
_sessionHandler.NegotiatedProtocolVersion = _negotiatedProtocolVersion;
LogClientSessionResumed(_endpointName);
}