- Newest
- Most votes
- Most comments
Hi there,
Would it be possible for you to copy the code you have on the Lambda@Edge to a normal Lambda? If you do that, then you could use our AWS Distro for OpenTelemetry (ADOT) Lambda Layers to profile your code and send traces to X-Ray to see where your bottlenecks are occurring for the Lambda part of your code.
Although Lambda may not be the exact same as Lambda@Edge, it might help you narrow down the cause for the slowdown. With the Lambda Layers we distribute for JavaScript, all you have to do is add your Lambda Layer and invoke your Lambda function. As long as it has permissions to send traces to X-Ray (the easiest way is to enable active tracing) then you'll see traces for your downstream S3 calls in the X-Ray console. The documentation I liked has options to trace the call in non-Lambda environments as well.
Hopefully you can try that and let us know if it helps you identify any slowdowns!
Thanks for the response! Is there a doc/guide that explains how to move from Lambda@Edge to normal lambda for a cloudfront distribution? The function associations are defined in the behaviors of the distribution, and for origin response it only gives me two options: "No Associations" and "Lambda@Edge". It seems I would need a third that would be something like just "Lambda", is that right? I'm still learning my way around aws so I'd greatly appreciate some direction, thank you!
Even though Lambda@Edge does not support X-Ray, does it by any chance support Lambda Layers? I'm assuming it does not, and I guess I mentioned this above already, but if it did you could use our documentation for adding OpenTelemetry Lambda Layers independent of X-Ray.
I'm not aware of any documentation for moving from Lambda@Edge to Lambda :/ But is your Lambda@Edge function really complicated? If it were simple enough then you could just copy and paste the function code a fresh new Lambda? It's not ideal but that should let you profile your code at least...
Towards OpenTelemetry, you might be interested in this Step by Step guide on adding OpenTelemetry to a Python Lambda I wrote just a few months ago. Even if you're not using Python the steps should be very similar!
Glad you're exploring AWS! :) I'll mention to my team that you'd like a tracing solution for Lambda@Edge, and we'll look for the opportunity to provide this enhancement!
In case you are still experiencing this problem, the recent release of the server-timing response header may be helpful in trying to track down where the latency is occurring. You can find further info on the server-timing header here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/understanding-response-headers-policies.html#server-timing-header
This is also something that AWS support can help you with, if you are still experiencing problems I would recommend opening a support case.
Relevant content
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
Hi! Have you solved the issue ? I am experiencing the same problem...Thanks for your help.