ratelimit: add support for Ratelimit.override per route - #45613
Merged
Conversation
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
The pedantic spell checker rejects the envoyproxy#45611 shorthand. Use the full issue URL, matching existing convention elsewhere in the repo. Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
kanurag94
force-pushed
the
rl-per-route-override
branch
from
June 12, 2026 17:34
ac294eb to
4a84066
Compare
wbpcode
approved these changes
Jun 13, 2026
Member
|
Awesome! |
This was referenced Jun 15, 2026
nezdolik
pushed a commit
to nezdolik/envoy
that referenced
this pull request
Jun 16, 2026
…5613) **Commit Message:** ratelimit: support the `RateLimit.limit` override on the `RateLimitConfig` path **Additional Description:** The `RateLimitConfig` path (HTTP rate limit filter's `rate_limits` and per-route `RateLimitPerRoute`) supported `hits_addend` but rejected the `limit` override, so the two couldn't be used on the same rule. This adds override support to that path, matching `Router::RateLimitPolicyEntryImpl`. - `RateLimitPolicy` now parses `RateLimit.Override` (when `no_limit == false`) into the existing `Router::DynamicMetadataRateLimitOverride` and applies it in `populateDescriptors` from dynamic metadata. - Both `FilterConfig` (filter-level `rate_limits`) and `FilterConfigPerRoute` construct `RateLimitConfig` with `no_limit=false`. The local rate limit filter keeps `no_limit=true` (the override is only meaningful for the gRPC RLS descriptor). **Risk Level:** Low — opt-in (only on `limit`, which previously errored), reuses the existing override impl, no change to existing descriptor output. **Testing:** New unit tests for override applied, override + `hits_addend` together, and missing-metadata; config tests for both the per-route and filter-level wiring. `ratelimit_config_test` and `config_test` pass locally. **Docs Changes:** Updated the `RateLimit.limit` field comment in `route_components.proto`. **Release Notes:** Added a `new_features` changelog entry. **Platform Specific Features:** None. Fixes envoyproxy#45611 --------- Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit Message: ratelimit: support the
RateLimit.limitoverride on theRateLimitConfigpathAdditional Description:
The
RateLimitConfigpath (HTTP rate limit filter'srate_limitsand per-routeRateLimitPerRoute) supportedhits_addendbut rejected thelimitoverride, so the two couldn't be used on the same rule. This adds override support to that path, matchingRouter::RateLimitPolicyEntryImpl.RateLimitPolicynow parsesRateLimit.Override(whenno_limit == false) into the existingRouter::DynamicMetadataRateLimitOverrideand applies it inpopulateDescriptorsfrom dynamic metadata.FilterConfig(filter-levelrate_limits) andFilterConfigPerRouteconstructRateLimitConfigwithno_limit=false. The local rate limit filter keepsno_limit=true(the override is only meaningful for the gRPC RLS descriptor).Risk Level: Low — opt-in (only on
limit, which previously errored), reuses the existing override impl, no change to existing descriptor output.Testing: New unit tests for override applied, override +
hits_addendtogether, and missing-metadata; config tests for both the per-route and filter-level wiring.ratelimit_config_testandconfig_testpass locally.Docs Changes: Updated the
RateLimit.limitfield comment inroute_components.proto.Release Notes: Added a
new_featureschangelog entry.Platform Specific Features: None.
Fixes #45611