@@ -224,7 +224,6 @@ describe('wrapMcpServerWithSentry', () => {
224
224
expect ( tracingModule . startSpan ) . toHaveBeenCalledWith (
225
225
expect . objectContaining ( {
226
226
name : 'tools/call get-weather' ,
227
- op : 'mcp.server' ,
228
227
forceTransaction : true ,
229
228
attributes : expect . objectContaining ( {
230
229
// Required
@@ -244,7 +243,9 @@ describe('wrapMcpServerWithSentry', () => {
244
243
'mcp.request.argument.location' : '"Seattle, WA"' ,
245
244
'mcp.request.argument.units' : '"metric"' ,
246
245
// Sentry-specific
246
+ 'sentry.op' : 'mcp.server' ,
247
247
'sentry.origin' : 'auto.function.mcp_server' ,
248
+ 'sentry.source' : 'route' ,
248
249
} ) ,
249
250
} ) ,
250
251
expect . any ( Function )
@@ -266,7 +267,7 @@ describe('wrapMcpServerWithSentry', () => {
266
267
expect ( tracingModule . startSpan ) . toHaveBeenCalledWith (
267
268
expect . objectContaining ( {
268
269
name : 'resources/read file:///docs/api.md' ,
269
- op : 'mcp.server' ,
270
+ forceTransaction : true ,
270
271
attributes : expect . objectContaining ( {
271
272
// Required
272
273
'mcp.method.name' : 'resources/read' ,
@@ -275,6 +276,16 @@ describe('wrapMcpServerWithSentry', () => {
275
276
'mcp.request.id' : 'req-2' ,
276
277
// Recommended
277
278
'mcp.session.id' : 'test-session-123' ,
279
+ // Transport attributes
280
+ 'mcp.transport' : 'http' ,
281
+ 'network.transport' : 'tcp' ,
282
+ 'network.protocol.version' : '2.0' ,
283
+ // Request arguments (JSON-stringified)
284
+ 'mcp.request.argument.uri' : '"file:///docs/api.md"' ,
285
+ // Sentry-specific
286
+ 'sentry.op' : 'mcp.server' ,
287
+ 'sentry.origin' : 'auto.function.mcp_server' ,
288
+ 'sentry.source' : 'route' ,
278
289
} ) ,
279
290
} ) ,
280
291
expect . any ( Function )
@@ -296,7 +307,7 @@ describe('wrapMcpServerWithSentry', () => {
296
307
expect ( tracingModule . startSpan ) . toHaveBeenCalledWith (
297
308
expect . objectContaining ( {
298
309
name : 'prompts/get analyze-code' ,
299
- op : 'mcp.server' ,
310
+ forceTransaction : true ,
300
311
attributes : expect . objectContaining ( {
301
312
// Required
302
313
'mcp.method.name' : 'prompts/get' ,
@@ -305,6 +316,16 @@ describe('wrapMcpServerWithSentry', () => {
305
316
'mcp.request.id' : 'req-3' ,
306
317
// Recommended
307
318
'mcp.session.id' : 'test-session-123' ,
319
+ // Transport attributes
320
+ 'mcp.transport' : 'http' ,
321
+ 'network.transport' : 'tcp' ,
322
+ 'network.protocol.version' : '2.0' ,
323
+ // Request arguments (JSON-stringified)
324
+ 'mcp.request.argument.name' : '"analyze-code"' ,
325
+ // Sentry-specific
326
+ 'sentry.op' : 'mcp.server' ,
327
+ 'sentry.origin' : 'auto.function.mcp_server' ,
328
+ 'sentry.source' : 'route' ,
308
329
} ) ,
309
330
} ) ,
310
331
expect . any ( Function )
@@ -325,16 +346,22 @@ describe('wrapMcpServerWithSentry', () => {
325
346
expect ( tracingModule . startSpan ) . toHaveBeenCalledWith (
326
347
expect . objectContaining ( {
327
348
name : 'notifications/tools/list_changed' ,
328
- op : 'mcp.server' ,
349
+ forceTransaction : true ,
329
350
attributes : expect . objectContaining ( {
330
351
// Required
331
352
'mcp.method.name' : 'notifications/tools/list_changed' ,
332
353
// Recommended
333
354
'mcp.session.id' : 'test-session-123' ,
334
355
// Notification-specific
335
356
'mcp.notification.direction' : 'client_to_server' ,
357
+ // Transport attributes
358
+ 'mcp.transport' : 'http' ,
359
+ 'network.transport' : 'tcp' ,
360
+ 'network.protocol.version' : '2.0' ,
336
361
// Sentry-specific
362
+ 'sentry.op' : 'mcp.server' ,
337
363
'sentry.origin' : 'auto.mcp.notification' ,
364
+ 'sentry.source' : 'route' ,
338
365
} ) ,
339
366
} ) ,
340
367
expect . any ( Function )
@@ -362,11 +389,19 @@ describe('wrapMcpServerWithSentry', () => {
362
389
expect ( tracingModule . startSpan ) . toHaveBeenCalledWith (
363
390
expect . objectContaining ( {
364
391
name : 'tools/list' ,
365
- op : 'mcp.server' ,
392
+ forceTransaction : true ,
366
393
attributes : expect . objectContaining ( {
367
394
'mcp.method.name' : 'tools/list' ,
368
395
'mcp.request.id' : 'req-4' ,
369
396
'mcp.session.id' : 'test-session-123' ,
397
+ // Transport attributes
398
+ 'mcp.transport' : 'http' ,
399
+ 'network.transport' : 'tcp' ,
400
+ 'network.protocol.version' : '2.0' ,
401
+ // Sentry-specific
402
+ 'sentry.op' : 'mcp.server' ,
403
+ 'sentry.origin' : 'auto.function.mcp_server' ,
404
+ 'sentry.source' : 'route' ,
370
405
} ) ,
371
406
} ) ,
372
407
expect . any ( Function )
0 commit comments