DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
113 stars 35 forks source link

Receiving datadog: handler not initialized error #416

Closed tianxingliu closed 1 year ago

tianxingliu commented 1 year ago

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

  1. Upgrade from Node14. to Node16.

Specifications

Hi, I just wanted to check if this is an expected behavior. So recently we upgrade our lambda to use Node14 to Node16, and since then we starting to receive the datadog: handler not initialized error. We were able to fix it by upgrading to the latest version and adding the datadog() wrapper to our handler function, but wondering why it was working properly before in Node14? Also even with the fix we still sees no datadog layer attached to the lambda via AWS's lambda console.

astuyve commented 1 year ago

Hi @tianxingliu – thanks for reaching out!

I'm not sure which deployment tool or method you're using, so it's hard to troubleshoot exactly why you don't see layers if you're using that method. Layers aren't required to use this library, you can also install it manually via npm/yarn. Using the datadog() method is similarly optional. If you choose not to redirect your handler (docs), then you do need to use the datadog() method. Again, this would depend on the installation method and IaC tool you're using.

We release support for new runtimes as they become available, so it's possible that the version you previously used did not yet have support for the node16.x runtime.

Either way I'm not sure how to help with this ticket as it seems that upgrading and reconfiguring your setup fixed the issue. As a result, I'll close this issue for now.

If you still are experiencing problems, feel free to open a new ticket with reproduction steps including the version numbers of the library you're using.

Thanks! AJ