diff --git a/envoy/config/filter/fault/v2/BUILD b/envoy/config/filter/fault/v2/BUILD index 9fba2fbe..c7f8a36e 100644 --- a/envoy/config/filter/fault/v2/BUILD +++ b/envoy/config/filter/fault/v2/BUILD @@ -9,4 +9,5 @@ api_proto_library_internal( "//envoy/config/filter/http/fault/v2:__pkg__", "//envoy/config/filter/network/mongo_proxy/v2:__pkg__", ], + deps = ["//envoy/type:percent"], ) diff --git a/envoy/config/filter/fault/v2/fault.proto b/envoy/config/filter/fault/v2/fault.proto index d8f06cee..8cfd17ed 100644 --- a/envoy/config/filter/fault/v2/fault.proto +++ b/envoy/config/filter/fault/v2/fault.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package envoy.config.filter.fault.v2; option go_package = "v2"; +import "envoy/type/percent.proto"; + import "google/protobuf/duration.proto"; import "validate/validate.proto"; @@ -24,7 +26,11 @@ message FaultDelay { // An integer between 0-100 indicating the percentage of operations/connection requests // on which the delay will be injected. - uint32 percent = 2 [(validate.rules).uint32.lte = 100]; + // + // .. attention:: + // + // Use of integer `percent` value is deprecated. Use fractional `percentage` field instead. + uint32 percent = 2 [(validate.rules).uint32.lte = 100, deprecated = true]; oneof fault_delay_secifier { option (validate.required) = true; @@ -37,4 +43,7 @@ message FaultDelay { google.protobuf.Duration fixed_delay = 3 [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; } + + // The percentage of operations/connection requests on which the delay will be injected. + envoy.type.FractionalPercent percentage = 4; } diff --git a/envoy/config/filter/http/fault/v2/BUILD b/envoy/config/filter/http/fault/v2/BUILD index 7b414c48..d2c935a1 100644 --- a/envoy/config/filter/http/fault/v2/BUILD +++ b/envoy/config/filter/http/fault/v2/BUILD @@ -8,5 +8,6 @@ api_proto_library_internal( deps = [ "//envoy/api/v2/route", "//envoy/config/filter/fault/v2:fault", + "//envoy/type:percent", ], ) diff --git a/envoy/config/filter/http/fault/v2/fault.proto b/envoy/config/filter/http/fault/v2/fault.proto index 894d2b78..36e1d01a 100644 --- a/envoy/config/filter/http/fault/v2/fault.proto +++ b/envoy/config/filter/http/fault/v2/fault.proto @@ -3,8 +3,9 @@ syntax = "proto3"; package envoy.config.filter.http.fault.v2; option go_package = "v2"; -import "envoy/config/filter/fault/v2/fault.proto"; import "envoy/api/v2/route/route.proto"; +import "envoy/config/filter/fault/v2/fault.proto"; +import "envoy/type/percent.proto"; import "validate/validate.proto"; @@ -14,7 +15,11 @@ import "validate/validate.proto"; message FaultAbort { // An integer between 0-100 indicating the percentage of requests/operations/connections // that will be aborted with the error code provided. - uint32 percent = 1 [(validate.rules).uint32.lte = 100]; + // + // .. attention:: + // + // Use of integer `percent` value is deprecated. Use fractional `percentage` field instead. + uint32 percent = 1 [(validate.rules).uint32.lte = 100, deprecated = true]; oneof error_type { option (validate.required) = true; @@ -22,6 +27,10 @@ message FaultAbort { // HTTP status code to use to abort the HTTP request. uint32 http_status = 2 [(validate.rules).uint32 = {gte: 200, lt: 600}]; } + + // The percentage of requests/operations/connections that will be aborted with the error code + // provided. + envoy.type.FractionalPercent percentage = 3; } message HTTPFault {