feat(lambda-promtail): allow setting Lambda reserved concurrency #16783
+8
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
TLDR: We were running into issues with lambda-promtail eating up all of our Lambda function concurrency and adding reserved concurrency will mitigate that.
For the uninitiated, from https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html
Given this, being able to configure reserved concurrency will help in AWS accounts that utilize Lambda heavily (not just for lambda-promtail) in a few ways. Since reserved concurrency is the max concurrency a function can run, it means that a deluge of events being sent to lambda-promtail won't exhaust all of the Lambda concurrency for the entire AWS account's region. On the other hand, since setting reserved concurrency means that function will always have that amount of concurrency reserved just for it, it can mitigate issues with delayed log messages during periods of heavily Lambda usage since the lambda-promtail function will be guaranteed to be able to handle N number of events (N being the reserved concurrency) number of events at any given time. My company was mainly having issues with the former where lambda-promtail would eat up all of our Lambda function concurrency and causing Lambda invokes to fail causing error rates for our entire platform to spike (not good!).
The default behavior in the Terraform AWS provider is to not set any reserved concurrency. It uses the
-1
value to denote this. To preserve that behavior, the default value for the new input variable is-1
.For the keen-eyed, provisioned concurrency is a different thing to reserved concurrency. Reserved concurrency is configured on the
aws_lambda_function
resource, but provisioned concurrency is configured via a separate resourceaws_lambda_provisioned_concurrency_config
. That distinction is the main reason this PR exists, since the Terraform module in this repo manages theaws_lambda_function
resource and currently does not expose thereserved_concurrent_executions
attribute.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR