Reputation: 502
The Datadog AWS Lambda instrumentation seems unreliable to me. Every few invocations, I get the following error:
"errorType": "Runtime.HandlerNotFound",
"errorMessage": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler is undefined or not exported",
"stack": [
"Runtime.HandlerNotFound: /opt/nodejs/node_modules/datadog-lambda-js/handler.handler is undefined or not exported",
" at HandlerNotFound.ExtendedError [as constructor] (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:113:28)",
" at new HandlerNotFound (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:131:42)",
" at load (/opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:151:15)",
" at Object.<anonymous> (/opt/nodejs/node_modules/datadog-lambda-js/handler.js:65:59)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Module.require (internal/modules/cjs/loader.js:887:19)",
" at require (internal/modules/cjs/helpers.js:74:18)"
]
}
To start the instrumentation, I run the following code.
datadog-ci lambda instrument \
-f my-lambda-name \
-r my-region \
-v 50 -e 15 \
--service my-service \
--env my-env \
--version 1.0
Any idea what I'm doing wrong?
Upvotes: 0
Views: 1664
Reputation: 502
Depending on the runtime environment, you should point to a different version of the datadog layer extensions.
Python, for example, uses -v 50 -e 15
, but Node.js handlers should use a different version, -v 66 -e 16
.
All of this is available in the documentation: https://docs.datadoghq.com/serverless/installation/nodejs/?tab=datadogcli
Upvotes: 0