11// NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil
2+ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core' ;
23import * as SentryNode from '@sentry/node' ;
34import type { Event } from '@sentry/types' ;
45import type { Callback , Handler } from 'aws-lambda' ;
@@ -206,7 +207,10 @@ describe('AWSLambda', () => {
206207 name : 'functionName' ,
207208 op : 'function.aws.lambda' ,
208209 origin : 'auto.function.serverless' ,
209- metadata : { source : 'component' } ,
210+ attributes : {
211+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
212+ } ,
213+ metadata : { } ,
210214 } ;
211215
212216 expect ( rv ) . toStrictEqual ( 42 ) ;
@@ -233,7 +237,10 @@ describe('AWSLambda', () => {
233237 name : 'functionName' ,
234238 op : 'function.aws.lambda' ,
235239 origin : 'auto.function.serverless' ,
236- metadata : { source : 'component' } ,
240+ attributes : {
241+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
242+ } ,
243+ metadata : { } ,
237244 } ;
238245
239246 expect ( SentryNode . startSpanManual ) . toBeCalledWith ( fakeTransactionContext , expect . any ( Function ) ) ;
@@ -274,11 +281,13 @@ describe('AWSLambda', () => {
274281 origin : 'auto.function.serverless' ,
275282 name : 'functionName' ,
276283 traceId : '12312012123120121231201212312012' ,
284+ attributes : {
285+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
286+ } ,
277287 metadata : {
278288 dynamicSamplingContext : {
279289 release : '2.12.1' ,
280290 } ,
281- source : 'component' ,
282291 } ,
283292 } ) ,
284293 expect . any ( Function ) ,
@@ -311,7 +320,10 @@ describe('AWSLambda', () => {
311320 traceId : '12312012123120121231201212312012' ,
312321 parentSpanId : '1121201211212012' ,
313322 parentSampled : false ,
314- metadata : { dynamicSamplingContext : { } , source : 'component' } ,
323+ attributes : {
324+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
325+ } ,
326+ metadata : { dynamicSamplingContext : { } } ,
315327 } ;
316328
317329 expect ( SentryNode . startSpanManual ) . toBeCalledWith ( fakeTransactionContext , expect . any ( Function ) ) ;
@@ -338,7 +350,10 @@ describe('AWSLambda', () => {
338350 name : 'functionName' ,
339351 op : 'function.aws.lambda' ,
340352 origin : 'auto.function.serverless' ,
341- metadata : { source : 'component' } ,
353+ attributes : {
354+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
355+ } ,
356+ metadata : { } ,
342357 } ;
343358
344359 expect ( rv ) . toStrictEqual ( 42 ) ;
@@ -376,7 +391,10 @@ describe('AWSLambda', () => {
376391 name : 'functionName' ,
377392 op : 'function.aws.lambda' ,
378393 origin : 'auto.function.serverless' ,
379- metadata : { source : 'component' } ,
394+ attributes : {
395+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
396+ } ,
397+ metadata : { } ,
380398 } ;
381399
382400 expect ( SentryNode . startSpanManual ) . toBeCalledWith ( fakeTransactionContext , expect . any ( Function ) ) ;
@@ -418,7 +436,10 @@ describe('AWSLambda', () => {
418436 name : 'functionName' ,
419437 op : 'function.aws.lambda' ,
420438 origin : 'auto.function.serverless' ,
421- metadata : { source : 'component' } ,
439+ attributes : {
440+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
441+ } ,
442+ metadata : { } ,
422443 } ;
423444
424445 expect ( rv ) . toStrictEqual ( 42 ) ;
@@ -456,7 +477,10 @@ describe('AWSLambda', () => {
456477 name : 'functionName' ,
457478 op : 'function.aws.lambda' ,
458479 origin : 'auto.function.serverless' ,
459- metadata : { source : 'component' } ,
480+ attributes : {
481+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'component' ,
482+ } ,
483+ metadata : { } ,
460484 } ;
461485
462486 expect ( SentryNode . startSpanManual ) . toBeCalledWith ( fakeTransactionContext , expect . any ( Function ) ) ;
0 commit comments