diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts index 8d0ed12f98..e4f24080f0 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts @@ -1041,6 +1041,19 @@ describe('lambda handler', () => { }); }); + describe('non-existent handler module', () => { + it('should skip instrumentation', async () => { + initializeHandler('lambda-test/callback.handle'); + + const handler = await lambdaLoadHandler('lambda-test/async.handler'); + const result = await handler('arg', ctx); + + assert.strictEqual(result, 'ok'); + const spans = memoryExporter.getFinishedSpans(); + assert.strictEqual(spans.length, 0); + }); + }); + describe('non-existent handler function', () => { it('should skip instrumentation', async () => { initializeHandler('lambda-test/async.handle');