File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
packages/core/src/integrations/mcp-server Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -176,12 +176,13 @@ export function getTransportTypes(transport: MCPTransport): { mcpTransport: stri
176176 * @param transport - MCP transport instance
177177 * @param extra - Optional extra handler data
178178 * @returns Transport attributes for span instrumentation
179+ * @note sessionId may be undefined during initial setup - session should be established by client during initialize flow
179180 */
180181export function buildTransportAttributes (
181182 transport : MCPTransport ,
182183 extra ?: ExtraHandlerData ,
183184) : Record < string , string | number > {
184- const sessionId = transport . sessionId ;
185+ const sessionId = transport && 'sessionId' in transport ? transport . sessionId : undefined ;
185186 const clientInfo = extra ? extractClientInfo ( extra ) : { } ;
186187 const { mcpTransport, networkTransport } = getTransportTypes ( transport ) ;
187188 const clientAttributes = getClientAttributes ( transport ) ;
You can’t perform that action at this time.
0 commit comments