overload.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. syntax = "proto3";
  2. package envoy.config.overload.v2alpha;
  3. import "google/protobuf/any.proto";
  4. import "google/protobuf/duration.proto";
  5. import "google/protobuf/struct.proto";
  6. import "udpa/annotations/status.proto";
  7. import "validate/validate.proto";
  8. option java_package = "io.envoyproxy.envoy.config.overload.v2alpha";
  9. option java_outer_classname = "OverloadProto";
  10. option java_multiple_files = true;
  11. option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/overload/v2alpha";
  12. option (udpa.annotations.file_status).package_version_status = FROZEN;
  13. // [#protodoc-title: Overload Manager]
  14. // The Overload Manager provides an extensible framework to protect Envoy instances
  15. // from overload of various resources (memory, cpu, file descriptors, etc).
  16. // It monitors a configurable set of resources and notifies registered listeners
  17. // when triggers related to those resources fire.
  18. message ResourceMonitor {
  19. // The name of the resource monitor to instantiate. Must match a registered
  20. // resource monitor type. The built-in resource monitors are:
  21. //
  22. // * :ref:`envoy.resource_monitors.fixed_heap
  23. // <envoy_api_msg_config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig>`
  24. // * :ref:`envoy.resource_monitors.injected_resource
  25. // <envoy_api_msg_config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig>`
  26. string name = 1 [(validate.rules).string = {min_bytes: 1}];
  27. // Configuration for the resource monitor being instantiated.
  28. oneof config_type {
  29. google.protobuf.Struct config = 2 [deprecated = true];
  30. google.protobuf.Any typed_config = 3;
  31. }
  32. }
  33. message ThresholdTrigger {
  34. // If the resource pressure is greater than or equal to this value, the trigger
  35. // will fire.
  36. double value = 1 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
  37. }
  38. message Trigger {
  39. // The name of the resource this is a trigger for.
  40. string name = 1 [(validate.rules).string = {min_bytes: 1}];
  41. oneof trigger_oneof {
  42. option (validate.required) = true;
  43. ThresholdTrigger threshold = 2;
  44. }
  45. }
  46. message OverloadAction {
  47. // The name of the overload action. This is just a well-known string that listeners can
  48. // use for registering callbacks. Custom overload actions should be named using reverse
  49. // DNS to ensure uniqueness.
  50. string name = 1 [(validate.rules).string = {min_bytes: 1}];
  51. // A set of triggers for this action. If any of these triggers fire the overload action
  52. // is activated. Listeners are notified when the overload action transitions from
  53. // inactivated to activated, or vice versa.
  54. repeated Trigger triggers = 2 [(validate.rules).repeated = {min_items: 1}];
  55. }
  56. message OverloadManager {
  57. // The interval for refreshing resource usage.
  58. google.protobuf.Duration refresh_interval = 1;
  59. // The set of resources to monitor.
  60. repeated ResourceMonitor resource_monitors = 2 [(validate.rules).repeated = {min_items: 1}];
  61. // The set of overload actions.
  62. repeated OverloadAction actions = 3;
  63. }