-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SAM] Hangs for the entire lambda timeout, then responds #176
Comments
Hey @distinctdan - thanks for reaching out! I suspect that the reason is because the AWS Lambda Runtime Interface Emulator is being used by SAM. The telemetry API is how Lambda Extensions communicate with the AWS Lambda Runtime, and we require it to tell us important things like:
Today we can't support the emulator because of this limitation. Instead, we recommend using a conditional variable to skip the Lambda Extension and Lambda Instrumentation when emulating locally. This has been an issue for a long time, so we'd appreciate if you leave a comment asking for this feature from AWS and mention it to your TAM. Thanks! |
Thanks for the info! I've commented on their issue. Since this is a known issue where we know DataDog isn't compatible with SAM local, I would request a documentation update on the DD side for the following:
|
Thanks @distinctdan - I've learned that we document the It may prevent the extension from hanging in your case though. Either way, our recommendation is to disable Datadog in a local emulation environment. Thanks! |
Thanks for the info, but unfortunately it looks like that flag doesn't change the behavior for me. At the very least, I would expect the DD lambda to emit some kind of log saying it can't connect instead of silently failing. I know it's not y'all's fault that this doesn't work, but I've spent several hours tracking this down, and some documentation or error logs on the datadog side would have made this a lot easier. |
Hi @distinctdan, thanks for the note. The connection from the extension to the telemetry API can be established, the issue is that no runtime events are passed (only logs). So for the extension, there's no way to know that we'll never receive those events. I will ask our documentation team to more clearly describe our recommendation to not use Datadog's instrumentation locally at this time. Thanks! |
I see, yeah that's pretty unfortunate. Ok, thanks for the help! |
Anytime! |
Hi @distinctdan - if you try out our new next-generation Lambda extension locally, you can specify a short flush interval via I hope this helps! |
Problem
Hi, I'm using AWS SAM and I'm running locally with
sam local start-api
. However, when I add the dd lambda extension layer, it causes my handler to run for the full timeout before responding normally. From my local logs, I can see that my handler is returning a value almost immediately, so the delay is from the dd lambda wrapper. This makes it very difficult to work locally, which is important to me. My guess is maybe it's failing to authenticate with datadog and timing out? But, it's not emitting any auth errors. Is there any way to get more information about why it's hanging?Sequence of events
sam build
, thensam local start-api
.Relevant code
bootstrap.go
:template.yaml
:github.com/DataDog/datadog-lambda-go v1.19.0
go1.22.6 darwin/amd64
The text was updated successfully, but these errors were encountered: