Add overload manager for Envoy (#3954)
Signed-off-by: Elisha Ziskind <eziskind@google.com> Mirrored from https://github.com/envoyproxy/envoy @ 83b9e2da8ad896f6e2a0b54e08cc79a6937714c8pull/620/head
parent
3e30543124
commit
45c971abe3
2 changed files with 71 additions and 0 deletions
@ -0,0 +1,8 @@ |
||||
load("//bazel:api_build_system.bzl", "api_proto_library_internal") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_library_internal( |
||||
name = "overload", |
||||
srcs = ["overload.proto"], |
||||
) |
@ -0,0 +1,63 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.overload.v2alpha; |
||||
option go_package = "v2alpha"; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
import "google/protobuf/struct.proto"; |
||||
|
||||
import "validate/validate.proto"; |
||||
|
||||
// The Overload Manager provides an extensible framework to protect Envoy instances |
||||
// from overload of various resources (memory, cpu, file descriptors, etc) |
||||
|
||||
message EmptyConfig { |
||||
} |
||||
|
||||
message ResourceMonitor { |
||||
// The name of the resource monitor to instantiate. Must match a registered |
||||
// resource monitor type. |
||||
string name = 1 [(validate.rules).string.min_bytes = 1]; |
||||
|
||||
// Configuration for the resource monitor being instantiated. |
||||
google.protobuf.Struct config = 2; |
||||
} |
||||
|
||||
message ThresholdTrigger { |
||||
// If the resource pressure is greater than or equal to this value, the trigger |
||||
// will fire. |
||||
double value = 1 [(validate.rules).double = {gte: 0, lte: 1}]; |
||||
} |
||||
|
||||
message Trigger { |
||||
// The name of the resource this is a trigger for. |
||||
string name = 1 [(validate.rules).string.min_bytes = 1]; |
||||
|
||||
oneof trigger_oneof { |
||||
option (validate.required) = true; |
||||
ThresholdTrigger threshold = 2; |
||||
} |
||||
} |
||||
|
||||
message OverloadAction { |
||||
// The name of the overload action. This is just a well-known string that listeners can |
||||
// use for registering callbacks. Custom overload actions should be named using reverse |
||||
// DNS to ensure uniqueness. |
||||
string name = 1 [(validate.rules).string.min_bytes = 1]; |
||||
|
||||
// A set of triggers for this action. If any of these triggers fires the overload action |
||||
// is activated. Listeners are notified when the overload action transitions from |
||||
// inactivated to activated, or vice versa. |
||||
repeated Trigger triggers = 2 [(validate.rules).repeated .min_items = 1]; |
||||
} |
||||
|
||||
message OverloadManager { |
||||
// The interval for refreshing resource usage. |
||||
google.protobuf.Duration refresh_interval = 1; |
||||
|
||||
// The set of resources to monitor. |
||||
repeated ResourceMonitor resource_monitors = 2 [(validate.rules).repeated .min_items = 1]; |
||||
|
||||
// The set of overload actions. |
||||
repeated OverloadAction actions = 3 [(validate.rules).repeated .min_items = 1]; |
||||
} |
Loading…
Reference in new issue