http fault: implement header controlled faults (#6318)

Part of https://github.com/envoyproxy/envoy/issues/5942

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 805683f835bd63e4b7b9d89059aa0d3783924a93
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 2f515eb92a
commit d28888569c
  1. 26
      envoy/config/filter/fault/v2/fault.proto
  2. 4
      envoy/config/filter/http/fault/v2/fault.proto

@ -19,19 +19,25 @@ import "gogoproto/gogo.proto";
// Delay specification is used to inject latency into the
// HTTP/gRPC/Mongo/Redis operation or delay proxying of TCP connections.
message FaultDelay {
// Fault delays are controlled via an HTTP header (if applicable). See the
// :ref:`http fault filter <config_http_filters_fault_injection_http_header>` documentation for
// more information.
message HeaderDelay {
}
enum FaultDelayType {
// Fixed delay (step function).
// Unused and deprecated.
FIXED = 0;
}
// Delay type to use (fixed|exponential|..). Currently, only fixed delay (step function) is
// supported.
FaultDelayType type = 1 [(validate.rules).enum.defined_only = true];
// Unused and deprecated. Will be removed in the next release.
FaultDelayType type = 1 [deprecated = true];
reserved 2;
oneof fault_delay_secifier {
option (validate.required) = true;
// Add a fixed delay before forwarding the operation upstream. See
// https://developers.google.com/protocol-buffers/docs/proto3#json for
// the JSON/YAML Duration mapping. For HTTP/Mongo/Redis, the specified
@ -40,6 +46,9 @@ message FaultDelay {
// for the specified period. This is required if type is FIXED.
google.protobuf.Duration fixed_delay = 3
[(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true];
// Fault delays are controlled via an HTTP header (if applicable).
HeaderDelay header_delay = 5;
}
// The percentage of operations/connections/requests on which the delay will be injected.
@ -54,11 +63,20 @@ message FaultRateLimit {
uint64 limit_kbps = 1 [(validate.rules).uint64.gte = 1];
}
// Rate limits are controlled via an HTTP header (if applicable). See the
// :ref:`http fault filter <config_http_filters_fault_injection_http_header>` documentation for
// more information.
message HeaderLimit {
}
oneof limit_type {
option (validate.required) = true;
// A fixed rate limit.
FixedLimit fixed_limit = 1;
// Rate limits are controlled via an HTTP header (if applicable).
HeaderLimit header_limit = 3;
}
// The percentage of operations/connections/requests on which the rate limit will be injected.

@ -80,7 +80,9 @@ message HTTPFault {
// amount due to the implementation details.
google.protobuf.UInt32Value max_active_faults = 6;
// The response rate limit to be applied to the response body of the stream.
// The response rate limit to be applied to the response body of the stream. When configured,
// the percentage can be overridden by the :ref:`fault.http.rate_limit.response_percent
// <config_http_filters_fault_injection_runtime>` runtime key.
//
// .. attention::
// This is a per-stream limit versus a connection level limit. This means that concurrent streams

Loading…
Cancel
Save