rate-limit - add unit_multiplier#40830
rate-limit - add unit_multiplier#40830Pawan-Bishnoi wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
2203c9d to
e423c43
Compare
|
|
||
| // Multiplier for the unit of time. For example, if unit is SECOND and unit_multiplier is 30, | ||
| // the rate limit will be applied per 30 seconds. If not specified, defaults to 1. | ||
| uint32 unit_multiplier = 3 [(validate.rules).uint32 = {gte: 1}]; |
There was a problem hiding this comment.
field name decided here: https://github.com/envoyproxy/envoy/pull/38529/files#r2058649168
Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>
Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>
Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>
aae79da to
8d1961d
Compare
|
@mattklein123 PTAL for API review. |
|
|
||
| // Multiplier for the unit of time. For example, if unit is SECOND and unit_multiplier is 30, | ||
| // the rate limit will be applied per 30 seconds. If not specified, defaults to 1. | ||
| uint32 unit_multiplier = 4; |
There was a problem hiding this comment.
Please do not touch v2 directory, it's an archive.
| // Multiplier for the unit of time. For example, if unit is SECOND and unit_multiplier is 30, | ||
| // the rate limit will be applied per 30 seconds. If not specified, defaults to 1. | ||
| // To prevent integer overflow and enforce reasonable limits, the maximum value is 2000. | ||
| uint32 unit_multiplier = 3 [(validate.rules).uint32 = {lte: 2000 gte: 1}]; |
There was a problem hiding this comment.
Please use google.protobuf.Uint32Wrapper if the default value is not 0.
| struct RateLimitOverride { | ||
| uint32_t requests_per_unit_; | ||
| envoy::type::v3::RateLimitUnit unit_; | ||
| uint32_t unit_multiplier_ = 1; |
There was a problem hiding this comment.
I don't think it's handling unset values correctly, or I'm missing it somewhere?
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
@kyessenov please help reopen this PR. I am working on review comments. Thank you! |
|
👍 for reopening |
Commit Message: add a unit multiplier field to rls proto
Additional Description: so that we can configure rate limits for n minutes/days etc.
Risk Level: Low
Testing: added
Release Notes: todo
Fixes: #33277