-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(aws-lambda): remove AWS Lambda API latency from kong latency #12835
Conversation
This commit removes the latency attributed to AWS Lambda API requests from Kong's measured latencies (latencies.kong, KONG_RESPONSE_LATENCY, X-Kong-Response-Latency), ensuring that these delays are not mistakenly considered as originating from Kong.
9933dc8
to
1025de2
Compare
One more question:
|
The
Yes, this is what serverless plugin expects. |
Just a note here. We have huge number of plugins that do round trips and network io in synchronous fashion. AWS lambda is just one. We have Azure Functions, we have OIDC, we have OPA, OAuth Introspection, Session. A lot of our plugins communicate to Redis, which are beyond Kong, but somewhat on our land as well. Whenever there is network io, it is really hard to determine who's fault the added latencies are. It is hard to tell where our code stops and where other reasons start to affect. If we were to measure our non-yielding code only, then it is usually just around 0-1ms (the code execution time). But if we need to do network io on request time it gets wildly compilicated to count any numbers. |
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.
@windmgc, Not a big deal, just thinking if it would be better to use kong.ctx.plugin
here (feel free to disagree and mark this resolved).
Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Successfully created cherry-pick PR for |
) * fix(aws-lambda): remove AWS Lambda API latency from kong latency This commit removes the latency attributed to AWS Lambda API requests from Kong's measured latencies (latencies.kong, KONG_RESPONSE_LATENCY, X-Kong-Response-Latency), ensuring that these delays are not mistakenly considered as originating from Kong. --------- Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com> (cherry picked from commit bf673ce)
Summary
This commit removes the latency attributed to AWS Lambda API requests from Kong's measured latencies (
latencies.kong
,KONG_RESPONSE_LATENCY
,X-Kong-Response-Latency
), ensuring that these delays are not mistakenly considered as originating from Kong.This is an alternative of #12678, but this PR fix the latency problem only within the AWS-Lambda plugin scope without introducing anything new, so that we can have a simple and appropriate fix for the user.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
FTI-5261