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
176
176
* @param transport - MCP transport instance
177
177
* @param extra - Optional extra handler data
178
178
* @returns Transport attributes for span instrumentation
179
+ * @note sessionId may be undefined during initial setup - session should be established by client during initialize flow
179
180
*/
180
181
export function buildTransportAttributes (
181
182
transport : MCPTransport ,
182
183
extra ?: ExtraHandlerData ,
183
184
) : Record < string , string | number > {
184
- const sessionId = transport . sessionId ;
185
+ const sessionId = transport && 'sessionId' in transport ? transport . sessionId : undefined ;
185
186
const clientInfo = extra ? extractClientInfo ( extra ) : { } ;
186
187
const { mcpTransport, networkTransport } = getTransportTypes ( transport ) ;
187
188
const clientAttributes = getClientAttributes ( transport ) ;
You can’t perform that action at this time.
0 commit comments