aws-otel-lambda icon indicating copy to clipboard operation
aws-otel-lambda copied to clipboard

Issue with aws-sdk v3

Open brucedeen opened this issue 4 years ago • 2 comments

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

  1. Using the layer arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-ver-0-19-0:1

brucedeen avatar May 27 '21 21:05 brucedeen

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

awssandra avatar Jun 01 '21 21:06 awssandra

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

github-actions[bot] avatar Oct 02 '22 20:10 github-actions[bot]

This issue was closed because it has been marked as stale for 30 days with no activity.

github-actions[bot] avatar Nov 06 '22 20:11 github-actions[bot]