Skip to content

Commit

Permalink
http fault: add response rate limit injection (#6267)
Browse files Browse the repository at this point in the history
Part of envoyproxy/envoy#5942

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

Mirrored from https://github.com/envoyproxy/envoy @ 628d1668d7dc9244e3a8fa3d3fbabca23e92e23d
  • Loading branch information
data-plane-api(CircleCI) committed Mar 15, 2019
1 parent 27ab049 commit 63f54b1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
23 changes: 21 additions & 2 deletions envoy/config/filter/fault/v2/fault.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ message FaultDelay {
[(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;
// The percentage of operations/connections/requests on which the delay will be injected.
type.FractionalPercent percentage = 4;
}

// Describes a rate limit to be applied.
message FaultRateLimit {
// Describes a fixed/constant rate limit.
message FixedLimit {
// The limit supplied in KiB/s.
uint64 limit_kbps = 1 [(validate.rules).uint64.gte = 1];
}

oneof limit_type {
option (validate.required) = true;

// A fixed rate limit.
FixedLimit fixed_limit = 1;
}

// The percentage of operations/connections/requests on which the rate limit will be injected.
type.FractionalPercent percentage = 2;
}
13 changes: 10 additions & 3 deletions envoy/config/filter/http/fault/v2/fault.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ message FaultAbort {

// The percentage of requests/operations/connections that will be aborted with the error code
// provided.
envoy.type.FractionalPercent percentage = 3;
type.FractionalPercent percentage = 3;
}

message HTTPFault {
// If specified, the filter will inject delays based on the values in the
// object. At least *abort* or *delay* must be specified.
envoy.config.filter.fault.v2.FaultDelay delay = 1;
// object.
filter.fault.v2.FaultDelay delay = 1;

// If specified, the filter will abort requests based on the values in
// the object. At least *abort* or *delay* must be specified.
Expand Down Expand Up @@ -79,4 +79,11 @@ message HTTPFault {
// limit. It's possible for the number of active faults to rise slightly above the configured
// 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.
//
// .. attention::
// This is a per-stream limit versus a connection level limit. This means that concurrent streams
// will each get an independent limit.
filter.fault.v2.FaultRateLimit response_rate_limit = 7;
}

0 comments on commit 63f54b1

Please sign in to comment.