-
Notifications
You must be signed in to change notification settings - Fork 121
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.