DataDog/datadog-lambda-js

Feature Request: Support a less invasive way of instrumenting lambdas

kbkk opened this issue · 2 comments

kbkk commented

Expected Behavior

I can set AWS_LAMBDA_EXEC_WRAPPER pointing to DD Lambda layer without touching anything else in the Lambda configuration in order to get tracing.

Here's an example of a similar tracing solution (OpenTelemetry): https://github.com/open-telemetry/opentelemetry-lambda/blob/main/nodejs/README.md

Actual Behavior

The current behavior is a terrible DX choice IMO:

  • I have to change my main lambda handler to /opt/nodejs/node_modules/datadog-lambda-js/handler.handler
  • Then I can configure DD_LAMBDA_HANDLER with my actual handler function

Thanks for the idea @kbkk ! This is mostly because our solution was implemented before AWS_LAMBDA_EXEC_WRAPPER came an option. In fact, we are indeed trying out a simpler solution to support tracing other runtimes, and will likely port it back to node.js in the future. This may take some time though.

@kbkk Thanks again for flagging this idea! Since we are already planning something similar internally while do not plan to directly work against this "issue" in the near future, I'm going to close this thread for hygiene. 🙇‍♂️