Skip to content

Commit c6c61d6

Browse files
committed
test fixes
1 parent 48b359b commit c6c61d6

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ test('Lambda layer SDK bundle sends events', async ({ request }) => {
3333
'sentry.op': 'function.aws.lambda',
3434
'cloud.account.id': '123453789012',
3535
'faas.id': 'arn:aws:lambda:us-east-1:123453789012:function:my-lambda',
36+
"faas.coldstart": true,
3637
'otel.kind': 'SERVER',
3738
},
3839
op: 'function.aws.lambda',

dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ test('AWS Serverless SDK sends events in ESM mode', async ({ request }) => {
2828
expect(transactionEvent.contexts?.trace).toEqual({
2929
data: {
3030
'sentry.sample_rate': 1,
31-
'sentry.source': 'component',
32-
'sentry.origin': 'auto.function.serverless',
31+
'sentry.source': 'custom',
32+
'sentry.origin': 'auto.otel.aws-lambda',
3333
'sentry.op': 'function.aws.lambda',
34+
'cloud.account.id': '123453789012',
35+
'faas.id': 'arn:aws:lambda:us-east-1:123453789012:function:my-lambda',
36+
"faas.coldstart": true,
37+
'otel.kind': 'SERVER',
3438
},
3539
op: 'function.aws.lambda',
36-
origin: 'auto.function.serverless',
40+
origin: 'auto.otel.aws-lambda',
3741
span_id: expect.stringMatching(/[a-f0-9]{16}/),
3842
status: 'ok',
3943
trace_id: expect.stringMatching(/[a-f0-9]{32}/),

packages/aws-serverless/src/sdk.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ export function wrapHandler<TEvent, TResult>(
336336
// Only start a trace and root span if the handler is not already wrapped by Otel instrumentation
337337
// Otherwise, we create two root spans (one from otel, one from our wrapper).
338338
// If Otel instrumentation didn't work or was filtered by users, we still want to trace the handler.
339+
// TODO(v9): Since bumping the OTEL Instrumentation, this is likely not needed anymore, we can possibly remove this
339340
if (options.startTrace && !isWrappedByOtel(handler)) {
340341
const traceData = getAwsTraceData(event as { headers?: Record<string, string> }, context);
341342

packages/node/test/integration/transactions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ describe('Integration | Transactions', () => {
680680

681681
expect(spans).toHaveLength(2);
682682

683-
expect(spans[0]!.description).toEqual('inner span 1');
684-
expect(spans[1]!.description).toEqual('inner span 2');
683+
expect(spans).toContainEqual(expect.objectContaining({ description: 'inner span 1' }));
684+
expect(spans).toContainEqual(expect.objectContaining({ description: 'inner span 2' }));
685685
});
686686
});

0 commit comments

Comments
 (0)