From e6c70470ad7659cb6531caf974bcbc860e8e897d Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 01:49:02 +0000 Subject: [PATCH] Local rate limit - add rate_limited_as_resource_exhausted flag (#29279) * Local rate limit - add rate_limited_as_resource_exhausted flag to change grpc status code Signed-off-by: Pawan Kumar Signed-off-by: Pawan Bishnoi * fix minor renaming error Signed-off-by: Pawan Bishnoi * fix precheck error Signed-off-by: Pawan Bishnoi * add test Signed-off-by: Pawan Bishnoi * fix format and typo Signed-off-by: Pawan Bishnoi * review comments Signed-off-by: Pawan Bishnoi --------- Signed-off-by: Pawan Bishnoi Mirrored from https://github.com/envoyproxy/envoy @ 88a80e6bbbee56de8c3899c75eaf36c46fad1aa7 --- .../filters/http/local_ratelimit/v3/local_rate_limit.proto | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto b/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto index 24f43713..c253d049 100644 --- a/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto +++ b/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto @@ -22,7 +22,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Local Rate limit :ref:`configuration overview `. // [#extension: envoy.filters.http.local_ratelimit] -// [#next-free-field: 15] +// [#next-free-field: 16] message LocalRateLimit { // The human readable prefix to use when emitting stats. string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; @@ -125,4 +125,9 @@ message LocalRateLimit { // no matching descriptor. If set to true, default token bucket will always // be consumed. Default is true. google.protobuf.BoolValue always_consume_default_token_bucket = 14; + + // Specifies whether a ``RESOURCE_EXHAUSTED`` gRPC code must be returned instead + // of the default ``UNAVAILABLE`` gRPC code for a rate limited gRPC call. The + // HTTP code will be 200 for a gRPC response. + bool rate_limited_as_resource_exhausted = 15; }