rewrite extension client and upgrade tokio#120
Conversation
replace lambda-extension crate with inline extension client to reduce file size. Upgrade tokio to 1.24 for improved performance
calavera
left a comment
There was a problem hiding this comment.
oh, this is interesting. I wonder what makes the extension crate compile size as big 🤔 I'll look into it too. Do you only care about one event? I don't understand how it works, I'm guessing Lambda will just queue the events for the extension and eventually discard them?
| let aws_lambda_runtime_api: String = | ||
| env::var("AWS_LAMBDA_RUNTIME_API").unwrap_or_else(|_| "127.0.0.1:9001".to_string()); | ||
| let client = hyper::Client::new(); | ||
| let register_req = hyper::Request::builder() |
There was a problem hiding this comment.
I think you're missing the User-Agent based on the environment variable that the lambda client injects for you.
There was a problem hiding this comment.
This is fine. We want to track invokes, not extensions registration calls.
|
An extension tells Lambda Service what events it's interested in by specifying the event names when it registers. Lambda will send only those events to the extension. The adapter specified no event names at registration. So Lambda will not return any events to it. The NEXT call will block forever. |
|
lambda-extension crate is a bit bloated. Probably should split into 3 crates: minimum base extension crate for extension api, logs api crate, and telemetry api crate. |
replace lambda-extension crate with inline extension client to reduce binary size by another 1MB.
Upgrade tokio to 1.24 for improved performance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.