@@ -113,7 +113,7 @@ describe('GCPFunction', () => {
113
113
expect ( Sentry . startTransaction ) . toBeCalledWith ( {
114
114
name : 'POST /path' ,
115
115
op : 'gcp.function.http' ,
116
- metadata : { baggage : [ { } , '' , true ] } ,
116
+ metadata : { baggage : [ { } , '' , true ] , source : 'url' } ,
117
117
} ) ;
118
118
// @ts -ignore see "Why @ts-ignore" note
119
119
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
@@ -153,6 +153,7 @@ describe('GCPFunction', () => {
153
153
'' ,
154
154
false ,
155
155
] ,
156
+ source : 'url' ,
156
157
} ,
157
158
} ) ,
158
159
) ;
@@ -178,7 +179,7 @@ describe('GCPFunction', () => {
178
179
traceId : '12312012123120121231201212312012' ,
179
180
parentSpanId : '1121201211212012' ,
180
181
parentSampled : false ,
181
- metadata : { baggage : [ { } , '' , false ] } ,
182
+ metadata : { baggage : [ { } , '' , false ] , source : 'url' } ,
182
183
} ) ;
183
184
// @ts -ignore see "Why @ts-ignore" note
184
185
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
@@ -245,7 +246,11 @@ describe('GCPFunction', () => {
245
246
} ;
246
247
const wrappedHandler = wrapEventFunction ( func ) ;
247
248
await expect ( handleEvent ( wrappedHandler ) ) . resolves . toBe ( 42 ) ;
248
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
249
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
250
+ name : 'event.type' ,
251
+ op : 'gcp.function.event' ,
252
+ metadata : { source : 'component' } ,
253
+ } ) ;
249
254
// @ts -ignore see "Why @ts-ignore" note
250
255
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
251
256
// @ts -ignore see "Why @ts-ignore" note
@@ -262,7 +267,11 @@ describe('GCPFunction', () => {
262
267
} ;
263
268
const wrappedHandler = wrapEventFunction ( handler ) ;
264
269
await expect ( handleEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
265
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
270
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
271
+ name : 'event.type' ,
272
+ op : 'gcp.function.event' ,
273
+ metadata : { source : 'component' } ,
274
+ } ) ;
266
275
// @ts -ignore see "Why @ts-ignore" note
267
276
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
268
277
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -284,7 +293,11 @@ describe('GCPFunction', () => {
284
293
} ) ;
285
294
const wrappedHandler = wrapEventFunction ( func ) ;
286
295
await expect ( handleEvent ( wrappedHandler ) ) . resolves . toBe ( 42 ) ;
287
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
296
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
297
+ name : 'event.type' ,
298
+ op : 'gcp.function.event' ,
299
+ metadata : { source : 'component' } ,
300
+ } ) ;
288
301
// @ts -ignore see "Why @ts-ignore" note
289
302
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
290
303
// @ts -ignore see "Why @ts-ignore" note
@@ -305,7 +318,11 @@ describe('GCPFunction', () => {
305
318
306
319
const wrappedHandler = wrapEventFunction ( handler ) ;
307
320
await expect ( handleEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
308
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
321
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
322
+ name : 'event.type' ,
323
+ op : 'gcp.function.event' ,
324
+ metadata : { source : 'component' } ,
325
+ } ) ;
309
326
// @ts -ignore see "Why @ts-ignore" note
310
327
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
311
328
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -324,7 +341,11 @@ describe('GCPFunction', () => {
324
341
} ;
325
342
const wrappedHandler = wrapEventFunction ( func ) ;
326
343
await expect ( handleEvent ( wrappedHandler ) ) . resolves . toBe ( 42 ) ;
327
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
344
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
345
+ name : 'event.type' ,
346
+ op : 'gcp.function.event' ,
347
+ metadata : { source : 'component' } ,
348
+ } ) ;
328
349
// @ts -ignore see "Why @ts-ignore" note
329
350
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
330
351
// @ts -ignore see "Why @ts-ignore" note
@@ -341,7 +362,11 @@ describe('GCPFunction', () => {
341
362
} ;
342
363
const wrappedHandler = wrapEventFunction ( handler ) ;
343
364
await expect ( handleEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
344
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
365
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
366
+ name : 'event.type' ,
367
+ op : 'gcp.function.event' ,
368
+ metadata : { source : 'component' } ,
369
+ } ) ;
345
370
// @ts -ignore see "Why @ts-ignore" note
346
371
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
347
372
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -359,7 +384,11 @@ describe('GCPFunction', () => {
359
384
} ;
360
385
const wrappedHandler = wrapEventFunction ( handler ) ;
361
386
await expect ( handleEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
362
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.event' } ) ;
387
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
388
+ name : 'event.type' ,
389
+ op : 'gcp.function.event' ,
390
+ metadata : { source : 'component' } ,
391
+ } ) ;
363
392
// @ts -ignore see "Why @ts-ignore" note
364
393
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
365
394
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -388,7 +417,11 @@ describe('GCPFunction', () => {
388
417
} ;
389
418
const wrappedHandler = wrapCloudEventFunction ( func ) ;
390
419
await expect ( handleCloudEvent ( wrappedHandler ) ) . resolves . toBe ( 42 ) ;
391
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.cloud_event' } ) ;
420
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
421
+ name : 'event.type' ,
422
+ op : 'gcp.function.cloud_event' ,
423
+ metadata : { source : 'component' } ,
424
+ } ) ;
392
425
// @ts -ignore see "Why @ts-ignore" note
393
426
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
394
427
// @ts -ignore see "Why @ts-ignore" note
@@ -405,7 +438,11 @@ describe('GCPFunction', () => {
405
438
} ;
406
439
const wrappedHandler = wrapCloudEventFunction ( handler ) ;
407
440
await expect ( handleCloudEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
408
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.cloud_event' } ) ;
441
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
442
+ name : 'event.type' ,
443
+ op : 'gcp.function.cloud_event' ,
444
+ metadata : { source : 'component' } ,
445
+ } ) ;
409
446
// @ts -ignore see "Why @ts-ignore" note
410
447
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
411
448
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -424,7 +461,11 @@ describe('GCPFunction', () => {
424
461
} ;
425
462
const wrappedHandler = wrapCloudEventFunction ( func ) ;
426
463
await expect ( handleCloudEvent ( wrappedHandler ) ) . resolves . toBe ( 42 ) ;
427
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.cloud_event' } ) ;
464
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
465
+ name : 'event.type' ,
466
+ op : 'gcp.function.cloud_event' ,
467
+ metadata : { source : 'component' } ,
468
+ } ) ;
428
469
// @ts -ignore see "Why @ts-ignore" note
429
470
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
430
471
// @ts -ignore see "Why @ts-ignore" note
@@ -441,7 +482,11 @@ describe('GCPFunction', () => {
441
482
} ;
442
483
const wrappedHandler = wrapCloudEventFunction ( handler ) ;
443
484
await expect ( handleCloudEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
444
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.cloud_event' } ) ;
485
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
486
+ name : 'event.type' ,
487
+ op : 'gcp.function.cloud_event' ,
488
+ metadata : { source : 'component' } ,
489
+ } ) ;
445
490
// @ts -ignore see "Why @ts-ignore" note
446
491
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
447
492
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
@@ -459,7 +504,11 @@ describe('GCPFunction', () => {
459
504
} ;
460
505
const wrappedHandler = wrapCloudEventFunction ( handler ) ;
461
506
await expect ( handleCloudEvent ( wrappedHandler ) ) . rejects . toThrowError ( error ) ;
462
- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'event.type' , op : 'gcp.function.cloud_event' } ) ;
507
+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
508
+ name : 'event.type' ,
509
+ op : 'gcp.function.cloud_event' ,
510
+ metadata : { source : 'component' } ,
511
+ } ) ;
463
512
// @ts -ignore see "Why @ts-ignore" note
464
513
expect ( Sentry . fakeScope . setSpan ) . toBeCalledWith ( Sentry . fakeTransaction ) ;
465
514
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
0 commit comments