Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions nodejs/packages/layer/src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,23 @@ 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: suppressInternalInstrumentation,
}),
new AwsLambdaInstrumentation({
disableAwsContextPropagation: disableAwsContextPropagation,
}),
...(typeof configureInstrumentations === "function"
? configureInstrumentations
: defaultConfigureInstrumentations)(),
...defaultInstruments,
...userInstrumentations,
];

// Register instrumentations synchronously to ensure code is patched even before provider is ready.
Expand Down
Loading