1
- import type { Span } from './types-hoist/span' ;
2
1
import type {
3
2
ExtraHandlerData ,
4
3
MCPServerInstance ,
5
4
MCPTransport ,
6
- SessionId ,
7
5
} from './utils/mcp-server/types' ;
8
6
import {
9
7
createMcpNotificationSpan ,
@@ -92,9 +90,10 @@ export function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S):
92
90
const originalOnClose = transport . onclose ;
93
91
transport . onclose = new Proxy ( originalOnClose , {
94
92
apply ( onCloseTarget , onCloseThisArg , onCloseArgs ) {
95
- if ( transport . sessionId ) {
96
- handleTransportOnClose ( transport . sessionId ) ;
97
- }
93
+ //TODO(bete): session and request correlation (methods at the bottom of this file)
94
+ // if (transport.sessionId) {
95
+ // handleTransportOnClose(transport.sessionId);
96
+ // }
98
97
return Reflect . apply ( onCloseTarget , onCloseThisArg , onCloseArgs ) ;
99
98
} ,
100
99
} ) ;
@@ -111,11 +110,11 @@ export function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S):
111
110
// SESSION AND REQUEST CORRELATION (Legacy support)
112
111
// =============================================================================
113
112
114
- const sessionAndRequestToRequestParentSpanMap = new Map < SessionId , Map < string , Span > > ( ) ;
113
+ // const sessionAndRequestToRequestParentSpanMap = new Map<SessionId, Map<string, Span>>();
115
114
116
- function handleTransportOnClose ( sessionId : SessionId ) : void {
117
- sessionAndRequestToRequestParentSpanMap . delete ( sessionId ) ;
118
- }
115
+ // function handleTransportOnClose(sessionId: SessionId): void {
116
+ // sessionAndRequestToRequestParentSpanMap.delete(sessionId);
117
+ // }
119
118
120
119
// TODO(bete): refactor this and associateContextWithRequestSpan to use the new span API.
121
120
// function handleTransportOnMessage(sessionId: SessionId, requestId: string): void {
0 commit comments