diff --git a/nodejs/packages/layer/src/wrapper.ts b/nodejs/packages/layer/src/wrapper.ts index 84dc044e6e..594d12888d 100644 --- a/nodejs/packages/layer/src/wrapper.ts +++ b/nodejs/packages/layer/src/wrapper.ts @@ -153,7 +153,7 @@ const lambdaAutoInstrumentConfig: AwsLambdaInstrumentationConfig = { disableAwsContextPropagation: true, eventContextExtractor: (event, context) => { // try to extract propagation from http headers first - const httpHeaders = event.headers || {}; + const httpHeaders = event?.headers || {}; const extractedHttpContext: OtelContext = propagation.extract( otelContext.active(), httpHeaders,