3933
*/
3934
private _logMcpServerLifecycle(server: IMcpLifecycleLogInfo & { readonly origin: McpLifecycleOrigin }): void {
3936
return;
3937
}
3939
>
3940
>
const state = this._translateSdkMcpStatus(server.name, server.status, server.error);
3941
>
const attributes: Record<string, OtelAttributeValue> = {
3942
>
mcpEvent: server.origin,
3943
>
mcpServer: server.name,
3944
>
mcpStatus: server.status,
3945
>
mcpState: state.kind,
3946
>
};
3947
>
if (server.source) { attributes.mcpSource = server.source; }
3948
>
if (server.transport) { attributes.mcpTransport = server.transport; }
3949
>
if (server.pluginName) { attributes.mcpPlugin = server.pluginName; }
3950
>
if (server.pluginVersion) { attributes.mcpPluginVersion = server.pluginVersion; }
3951
>
if (state.kind === McpServerStatus.Error) { attributes.errorType = state.error.errorType; }
3952
>
3953
>
const detail = server.error ? `: ${server.error}` : '';
3954
>
const message = `[Copilot:${this.sessionId}] MCP server '${server.name}' ${server.status} (${state.kind})${detail}`;
3955
>
if (server.status === 'failed') {
3956
this._logService.error(message, new OtelData(attributes));
3958
this._logService.info(message, new OtelData(attributes));
3959
}
3961
3962
private _setToolCallUiMeta(meta: Mutable<IToolCallMeta>, resourceUri: string | undefined, mcpServerName: string | undefined): void {