Issue with aws-sdk v3
I have a NodeJS Runtime 12 lambda.
Issue I'm facing
When I run the lambda the following occurs
{
"errorType": "TypeError",
"errorMessage": "Cannot redefine property: constructStack",
"trace": [
"TypeError: Cannot redefine property: constructStack",
" at Function.defineProperty (<anonymous>)",
" at defineProperty (/opt/nodejs/node_modules/shimmer/index.js:14:10)",
" at AwsInstrumentation.wrap [as _wrap] (/opt/nodejs/node_modules/shimmer/index.js:56:3)",
" at AwsInstrumentation.patchV3ConstructStack (/opt/nodejs/node_modules/opentelemetry-instrumentation-aws-sdk/dist/src/aws-sdk.js:41:14)",
" at AwsInstrumentation._onRequire (/opt/nodejs/node_modules/opentelemetry-instrumentation-aws-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js:75:39)",
" at /opt/nodejs/node_modules/opentelemetry-instrumentation-aws-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js:115:29",
" at Module.Hook._require.Module.require (/opt/nodejs/node_modules/require-in-the-middle/index.js:154:32)",
" at Module.Hook._require.Module.require (/opt/nodejs/node_modules/require-in-the-middle/index.js:80:39)",
" at Module.Hook._require.Module.require (/opt/nodejs/node_modules/require-in-the-middle/index.js:80:39)",
" at Module.Hook._require.Module.require (/opt/nodejs/node_modules/require-in-the-middle/index.js:80:39)"
]
}
My setup
I have active tracing enabled.
I have AWS_LAMBDA_EXEC_WRAPPER set to /opt/otel-handler.
I've added the layer arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-ver-0-18-0:1
I'm using CDK to deploy the lambda. I'm using pure javascript (although many of the modules are using TS). The node module references both aws-sdk and @aws-sdk modules.
Other things I've tried
- Using the layer arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-ver-0-19-0:1
Hey brucedeen,
Looks like this might be an issue on the AWS SDK instumentation itself. That instrumentation library was community contibution, not developed by us.
We'll take a look and see what we can find. Do you have a reproduction case we can take a look at?
Thanks, Sandra
This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled
This issue was closed because it has been marked as stale for 30 days with no activity.