Open jzyeezy opened 1 year ago
Hi @jzyeezy 👋 thanks for reaching out and sharing your findings!
This is very useful, indeed.
I agree with you that the stream response isn't that useful for the executor to power-tune your function (unless that's all your function is doing). Did you manage to obtain useful power-tuning results even without returning a response?
I haven't converted the whole project to SDK v3 yet, but it'd be a good idea in general :) There's just a lot of tests that will need to be reshaped to work with v3, so I haven't found the time yet.
Any chance you could share your fork/branch with me so I can have a look?
Hey @alexcasalboni, sure happy to help.
Did you manage to obtain useful power-tuning results even without returning a response?
Yes! This tool generated some compelling cost signals which helps us narrow the scope on compute options to measure in real performance testing.
Here are my changes. A couple things to note:
executor
lambdaInvokeWithResponseStreamCommand
. I opted to create my own lambda layer, which is why you see changes in the layer-sdk
directory.
First off, I'd like to say that this project is awesome and very well documented. The provided terraform config was really helpful while I was troubleshooting.
My team owns a lambda which returns a response stream. Since the stream pattern allows for responses >6MB payload limitation, the execution of the Step Function's
executor
will fail with:The implementation of the
executor
lambda uses the V2 aws-sdk, which doesn't include theInvokeWithResponseStream
method. I've created a branch to update theexecutor
lambda to be implemented with the V3 aws-sdk and could successfully get past this hurdle using this as the utilsinvokeLambda
method:where the response has the shape of:
and the payload
But it unfortunately appears the
LogType: 'Tail'
parameter only works with synchronously invoked functions (documented here). This means the logs containing the "Billing Duration" stats aren't returned and theanalyzer
lambda will fail because there's nothing to analyze.I was able to work around this issue by updating my lambda to not return a payload, since I've rationalized successfully getting a real response by the power-tuner's
executor
lambda isn't all that important in measuring cost/compute. However, I thought I'd bring up this use-case and share what I was able to get working in case this comes up for anyone else.Thanks for putting this together!