diff --git a/envoy/api/v2/cluster/BUILD b/envoy/api/v2/cluster/BUILD index 69168ad0..8ac86d1f 100644 --- a/envoy/api/v2/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -7,6 +7,7 @@ licenses(["notice"]) # Apache 2 api_proto_package( deps = [ "//envoy/api/v2/core:pkg", + "//envoy/type:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", ], ) diff --git a/envoy/api/v2/cluster/circuit_breaker.proto b/envoy/api/v2/cluster/circuit_breaker.proto index ab9f5b06..a40eca89 100644 --- a/envoy/api/v2/cluster/circuit_breaker.proto +++ b/envoy/api/v2/cluster/circuit_breaker.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package envoy.api.v2.cluster; import "envoy/api/v2/core/base.proto"; +import "envoy/type/percent.proto"; import "google/protobuf/wrappers.proto"; @@ -23,8 +24,23 @@ option (udpa.annotations.file_migrate).move_to_package = "envoy.config.cluster.v message CircuitBreakers { // A Thresholds defines CircuitBreaker settings for a // :ref:`RoutingPriority`. - // [#next-free-field: 8] + // [#next-free-field: 9] message Thresholds { + message RetryBudget { + // Specifies the limit on concurrent retries as a percentage of the sum of active requests and + // active pending requests. For example, if there are 100 active requests and the + // budget_percent is set to 25, there may be 25 active retries. + // + // This parameter is optional. Defaults to 20%. + type.Percent budget_percent = 1; + + // Specifies the minimum retry concurrency allowed for the retry budget. The limit on the + // number of active retries may never go below this number. + // + // This parameter is optional. Defaults to 3. + google.protobuf.UInt32Value min_retry_concurrency = 2; + } + // The :ref:`RoutingPriority` // the specified CircuitBreaker settings apply to. core.RoutingPriority priority = 1 [(validate.rules).enum = {defined_only: true}]; @@ -45,9 +61,23 @@ message CircuitBreakers { // upstream cluster. If not specified, the default is 3. google.protobuf.UInt32Value max_retries = 5; + // Specifies a limit on concurrent retries in relation to the number of active requests. This + // parameter is optional. + // + // .. note:: + // + // If this field is set, the retry budget will override any configured retry circuit + // breaker. + RetryBudget retry_budget = 8; + // If track_remaining is true, then stats will be published that expose // the number of resources remaining until the circuit breakers open. If // not specified, the default is false. + // + // .. note:: + // + // If a retry budget is used in lieu of the max_retries circuit breaker, + // the remaining retry resources remaining will not be tracked. bool track_remaining = 6; // The maximum number of connection pools per cluster that Envoy will concurrently support at diff --git a/envoy/config/cluster/v3alpha/circuit_breaker.proto b/envoy/config/cluster/v3alpha/circuit_breaker.proto index b9c1cb72..a84cec0d 100644 --- a/envoy/config/cluster/v3alpha/circuit_breaker.proto +++ b/envoy/config/cluster/v3alpha/circuit_breaker.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package envoy.config.cluster.v3alpha; import "envoy/config/core/v3alpha/base.proto"; +import "envoy/type/v3alpha/percent.proto"; import "google/protobuf/wrappers.proto"; @@ -24,11 +25,29 @@ message CircuitBreakers { // A Thresholds defines CircuitBreaker settings for a // :ref:`RoutingPriority`. - // [#next-free-field: 8] + // [#next-free-field: 9] message Thresholds { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.cluster.CircuitBreakers.Thresholds"; + message RetryBudget { + option (udpa.annotations.versioning).previous_message_type = + "envoy.api.v2.cluster.CircuitBreakers.Thresholds.RetryBudget"; + + // Specifies the limit on concurrent retries as a percentage of the sum of active requests and + // active pending requests. For example, if there are 100 active requests and the + // budget_percent is set to 25, there may be 25 active retries. + // + // This parameter is optional. Defaults to 20%. + type.v3alpha.Percent budget_percent = 1; + + // Specifies the minimum retry concurrency allowed for the retry budget. The limit on the + // number of active retries may never go below this number. + // + // This parameter is optional. Defaults to 3. + google.protobuf.UInt32Value min_retry_concurrency = 2; + } + // The :ref:`RoutingPriority` // the specified CircuitBreaker settings apply to. core.v3alpha.RoutingPriority priority = 1 [(validate.rules).enum = {defined_only: true}]; @@ -49,9 +68,23 @@ message CircuitBreakers { // upstream cluster. If not specified, the default is 3. google.protobuf.UInt32Value max_retries = 5; + // Specifies a limit on concurrent retries in relation to the number of active requests. This + // parameter is optional. + // + // .. note:: + // + // If this field is set, the retry budget will override any configured retry circuit + // breaker. + RetryBudget retry_budget = 8; + // If track_remaining is true, then stats will be published that expose // the number of resources remaining until the circuit breakers open. If // not specified, the default is false. + // + // .. note:: + // + // If a retry budget is used in lieu of the max_retries circuit breaker, + // the remaining retry resources remaining will not be tracked. bool track_remaining = 6; // The maximum number of connection pools per cluster that Envoy will concurrently support at