...

Text file src/github.com/datawire/ambassador/v2/api/envoy/config/overload/v3/overload.proto

Documentation: github.com/datawire/ambassador/v2/api/envoy/config/overload/v3

     1syntax = "proto3";
     2
     3package envoy.config.overload.v3;
     4
     5import "envoy/type/v3/percent.proto";
     6
     7import "google/protobuf/any.proto";
     8import "google/protobuf/duration.proto";
     9import "google/protobuf/struct.proto";
    10
    11import "udpa/annotations/status.proto";
    12import "udpa/annotations/versioning.proto";
    13import "validate/validate.proto";
    14
    15option java_package = "io.envoyproxy.envoy.config.overload.v3";
    16option java_outer_classname = "OverloadProto";
    17option java_multiple_files = true;
    18option (udpa.annotations.file_status).package_version_status = ACTIVE;
    19
    20// [#protodoc-title: Overload Manager]
    21
    22// The Overload Manager provides an extensible framework to protect Envoy instances
    23// from overload of various resources (memory, cpu, file descriptors, etc).
    24// It monitors a configurable set of resources and notifies registered listeners
    25// when triggers related to those resources fire.
    26
    27message ResourceMonitor {
    28  option (udpa.annotations.versioning).previous_message_type =
    29      "envoy.config.overload.v2alpha.ResourceMonitor";
    30
    31  reserved 2;
    32
    33  reserved "config";
    34
    35  // The name of the resource monitor to instantiate. Must match a registered
    36  // resource monitor type. The built-in resource monitors are:
    37  //
    38  // * :ref:`envoy.resource_monitors.fixed_heap
    39  //   <envoy_api_msg_config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig>`
    40  // * :ref:`envoy.resource_monitors.injected_resource
    41  //   <envoy_api_msg_config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig>`
    42  string name = 1 [(validate.rules).string = {min_len: 1}];
    43
    44  // Configuration for the resource monitor being instantiated.
    45  oneof config_type {
    46    google.protobuf.Any typed_config = 3;
    47  }
    48}
    49
    50message ThresholdTrigger {
    51  option (udpa.annotations.versioning).previous_message_type =
    52      "envoy.config.overload.v2alpha.ThresholdTrigger";
    53
    54  // If the resource pressure is greater than or equal to this value, the trigger
    55  // will enter saturation.
    56  double value = 1 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
    57}
    58
    59message ScaledTrigger {
    60  // If the resource pressure is greater than this value, the trigger will be in the
    61  // :ref:`scaling <arch_overview_overload_manager-triggers-state>` state with value
    62  // `(pressure - scaling_threshold) / (saturation_threshold - scaling_threshold)`.
    63  double scaling_threshold = 1 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
    64
    65  // If the resource pressure is greater than this value, the trigger will enter saturation.
    66  double saturation_threshold = 2 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
    67}
    68
    69message Trigger {
    70  option (udpa.annotations.versioning).previous_message_type =
    71      "envoy.config.overload.v2alpha.Trigger";
    72
    73  // The name of the resource this is a trigger for.
    74  string name = 1 [(validate.rules).string = {min_len: 1}];
    75
    76  oneof trigger_oneof {
    77    option (validate.required) = true;
    78
    79    ThresholdTrigger threshold = 2;
    80
    81    ScaledTrigger scaled = 3;
    82  }
    83}
    84
    85// Typed configuration for the "envoy.overload_actions.reduce_timeouts" action. See
    86// :ref:`the docs <config_overload_manager_reducing_timeouts>` for an example of how to configure
    87// the action with different timeouts and minimum values.
    88message ScaleTimersOverloadActionConfig {
    89  enum TimerType {
    90    // Unsupported value; users must explicitly specify the timer they want scaled.
    91    UNSPECIFIED = 0;
    92
    93    // Adjusts the idle timer for downstream HTTP connections that takes effect when there are no active streams.
    94    // This affects the value of :ref:`HttpConnectionManager.common_http_protocol_options.idle_timeout
    95    // <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.idle_timeout>`
    96    HTTP_DOWNSTREAM_CONNECTION_IDLE = 1;
    97
    98    // Adjusts the idle timer for HTTP streams initiated by downstream clients.
    99    // This affects the value of :ref:`RouteAction.idle_timeout <envoy_v3_api_field_config.route.v3.RouteAction.idle_timeout>` and
   100    // :ref:`HttpConnectionManager.stream_idle_timeout
   101    // <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
   102    HTTP_DOWNSTREAM_STREAM_IDLE = 2;
   103  }
   104
   105  message ScaleTimer {
   106    // The type of timer this minimum applies to.
   107    TimerType timer = 1 [(validate.rules).enum = {defined_only: true not_in: 0}];
   108
   109    oneof overload_adjust {
   110      option (validate.required) = true;
   111
   112      // Sets the minimum duration as an absolute value.
   113      google.protobuf.Duration min_timeout = 2;
   114
   115      // Sets the minimum duration as a percentage of the maximum value.
   116      type.v3.Percent min_scale = 3;
   117    }
   118  }
   119
   120  // A set of timer scaling rules to be applied.
   121  repeated ScaleTimer timer_scale_factors = 1 [(validate.rules).repeated = {min_items: 1}];
   122}
   123
   124message OverloadAction {
   125  option (udpa.annotations.versioning).previous_message_type =
   126      "envoy.config.overload.v2alpha.OverloadAction";
   127
   128  // The name of the overload action. This is just a well-known string that listeners can
   129  // use for registering callbacks. Custom overload actions should be named using reverse
   130  // DNS to ensure uniqueness.
   131  string name = 1 [(validate.rules).string = {min_len: 1}];
   132
   133  // A set of triggers for this action. The state of the action is the maximum
   134  // state of all triggers, which can be scaling between 0 and 1 or saturated. Listeners
   135  // are notified when the overload action changes state.
   136  repeated Trigger triggers = 2 [(validate.rules).repeated = {min_items: 1}];
   137
   138  // Configuration for the action being instantiated.
   139  google.protobuf.Any typed_config = 3;
   140}
   141
   142message OverloadManager {
   143  option (udpa.annotations.versioning).previous_message_type =
   144      "envoy.config.overload.v2alpha.OverloadManager";
   145
   146  // The interval for refreshing resource usage.
   147  google.protobuf.Duration refresh_interval = 1;
   148
   149  // The set of resources to monitor.
   150  repeated ResourceMonitor resource_monitors = 2 [(validate.rules).repeated = {min_items: 1}];
   151
   152  // The set of overload actions.
   153  repeated OverloadAction actions = 3;
   154}

View as plain text