Add support for drop category policy and reporting (#3894)

This PR contains changes to implement feature requested in issue #3823
 - Adding DropOverload in eds policy which can be used to specify
 drop_percentage per category.
 - Adding DroppedRequests in load_report which can report deliberately
 dropped requests for each category.

Signed-off-by: vishalpowar <vishal.powar@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ 3ee3aa34d826fa1783c201fbf99dfec3a21eed53
pull/620/head
data-plane-api(CircleCI) 7 years ago
parent 40a1f42ffb
commit 0cee78e475
  1. 2
      envoy/api/v2/BUILD
  2. 36
      envoy/api/v2/eds.proto
  3. 10
      envoy/api/v2/endpoint/load_report.proto

@ -40,6 +40,7 @@ api_proto_library_internal(
"//envoy/api/v2/core:base",
"//envoy/api/v2/core:health_check",
"//envoy/api/v2/endpoint",
"//envoy/type:percent",
],
)
@ -52,6 +53,7 @@ api_go_grpc_library(
"//envoy/api/v2/core:base_go_proto",
"//envoy/api/v2/core:health_check_go_proto",
"//envoy/api/v2/endpoint:endpoint_go_proto",
"//envoy/type:percent_go_proto",
],
)

@ -6,6 +6,7 @@ option java_generic_services = true;
import "envoy/api/v2/discovery.proto";
import "envoy/api/v2/endpoint/endpoint.proto";
import "envoy/type/percent.proto";
import "google/api/annotations.proto";
@ -50,12 +51,35 @@ message ClusterLoadAssignment {
// Load balancing policy settings.
message Policy {
// Percentage of traffic (0-100) that should be dropped. This
// action allows protection of upstream hosts should they unable to
// recover from an outage or should they be unable to autoscale and hence
// overall incoming traffic volume need to be trimmed to protect them.
// [#v2-api-diff: This is known as maintenance mode in v1.]
double drop_overload = 1 [(validate.rules).double = {gte: 0, lte: 100}];
reserved 1;
message DropOverload {
// Identifier for the policy specifying the drop.
string category = 1 [(validate.rules).string.min_bytes = 1];
// Percentage of traffic that should be dropped for the category.
envoy.type.Percent drop_percentage = 2;
}
// Action to trim the overall incoming traffic to protect the upstream
// hosts. This action allows protection in case the hosts are unable to
// recover from an outage, or unable to autoscale or unable to handle
// incoming traffic volume for any reason.
//
// At the client each category is applied one after the other to generate
// the 'actual' drop percentage on all outgoing traffic. For example:
//
// .. code-block:: json
//
// { "drop_overloads": [
// { "category": "throttle", "drop_percentage": 60 }
// { "category": "lb", "drop_percentage": 50 }
// ]}
//
// The actual drop percentages applied to the traffic at the clients will be
// "throttle"_drop = 60%
// "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%.
// actual_outgoing_load = 20% // remaining after applying all categories.
repeated DropOverload drop_overloads = 2;
}
// Load balancing policy settings.

@ -96,6 +96,16 @@ message ClusterStats {
// deliberately dropped by the drop_overload policy and circuit breaking.
uint64 total_dropped_requests = 3;
message DroppedRequests {
// Identifier for the policy specifying the drop.
string category = 1 [(validate.rules).string.min_bytes = 1];
// Total number of deliberately dropped requests for the category.
uint64 dropped_count = 2;
}
// Information about deliberately dropped requests for each category specified
// in the DropOverload policy.
repeated DroppedRequests dropped_requests = 5;
// Period over which the actual load report occurred. This will be guaranteed to include every
// request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy
// and the *LoadStatsResponse* message sent from the management server, this may be longer than

Loading…
Cancel
Save