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 <pawanbishnoi@outlook.com>

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

* fix minor renaming error

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

* fix precheck error

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

* add test

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

* fix format and typo

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

* review comments

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

---------

Signed-off-by: Pawan Bishnoi <pawanbishnoi@outlook.com>

Mirrored from https://github.com/envoyproxy/envoy @ 88a80e6bbbee56de8c3899c75eaf36c46fad1aa7
main
update-envoy[bot] 1 year ago
parent f772a970a7
commit e6c70470ad
  1. 7
      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 <config_http_filters_local_rate_limit>`. // Local Rate limit :ref:`configuration overview <config_http_filters_local_rate_limit>`.
// [#extension: envoy.filters.http.local_ratelimit] // [#extension: envoy.filters.http.local_ratelimit]
// [#next-free-field: 15] // [#next-free-field: 16]
message LocalRateLimit { message LocalRateLimit {
// The human readable prefix to use when emitting stats. // The human readable prefix to use when emitting stats.
string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; 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 // no matching descriptor. If set to true, default token bucket will always
// be consumed. Default is true. // be consumed. Default is true.
google.protobuf.BoolValue always_consume_default_token_bucket = 14; 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;
} }

Loading…
Cancel
Save