From db63deb460999e104139bae10e387e2ba0153900 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Sun, 1 Feb 2026 15:37:11 +0530 Subject: [PATCH] fix: fix defaultInstrumentation never being registered bug --- nodejs/packages/layer/src/wrapper.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nodejs/packages/layer/src/wrapper.ts b/nodejs/packages/layer/src/wrapper.ts index b7a7d97..9eb247d 100644 --- a/nodejs/packages/layer/src/wrapper.ts +++ b/nodejs/packages/layer/src/wrapper.ts @@ -199,6 +199,14 @@ if (logLevel === DiagLogLevel.DEBUG) { ); } +// Get user-configured instrumentations (if any) +const userInstrumentations = typeof global.configureInstrumentations === "function" + ? global.configureInstrumentations() + : []; + +// Always include default instrumentations (HttpInstrumentation, etc.) +const defaultInstruments = defaultConfigureInstrumentations(); + const instrumentations = [ new AwsInstrumentation({ suppressInternalInstrumentation: true, @@ -206,9 +214,8 @@ const instrumentations = [ new AwsLambdaInstrumentation({ disableAwsContextPropagation: disableAwsContextPropagation, }), - ...(typeof configureInstrumentations === "function" - ? configureInstrumentations - : defaultConfigureInstrumentations)(), + ...defaultInstruments, + ...userInstrumentations, ]; // Register instrumentations synchronously to ensure code is patched even before provider is ready.