xref: /aosp_15_r20/external/grpc-grpc-java/xds/third_party/envoy/src/main/proto/envoy/config/filter/http/fault/v2/fault.proto (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1syntax = "proto3";
2
3package envoy.config.filter.http.fault.v2;
4
5import "envoy/api/v2/route/route_components.proto";
6import "envoy/config/filter/fault/v2/fault.proto";
7import "envoy/type/percent.proto";
8
9import "google/protobuf/wrappers.proto";
10
11import "udpa/annotations/migrate.proto";
12import "udpa/annotations/status.proto";
13import "validate/validate.proto";
14
15option java_package = "io.envoyproxy.envoy.config.filter.http.fault.v2";
16option java_outer_classname = "FaultProto";
17option java_multiple_files = true;
18option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/fault/v2;faultv2";
19option (udpa.annotations.file_migrate).move_to_package = "envoy.extensions.filters.http.fault.v3";
20option (udpa.annotations.file_status).package_version_status = FROZEN;
21
22// [#protodoc-title: Fault Injection]
23// Fault Injection :ref:`configuration overview <config_http_filters_fault_injection>`.
24// [#extension: envoy.filters.http.fault]
25
26message FaultAbort {
27  // Fault aborts are controlled via an HTTP header (if applicable). See the
28  // :ref:`HTTP fault filter <config_http_filters_fault_injection_http_header>` documentation for
29  // more information.
30  message HeaderAbort {
31  }
32
33  reserved 1;
34
35  oneof error_type {
36    option (validate.required) = true;
37
38    // HTTP status code to use to abort the HTTP request.
39    uint32 http_status = 2 [(validate.rules).uint32 = {lt: 600 gte: 200}];
40
41    // Fault aborts are controlled via an HTTP header (if applicable).
42    HeaderAbort header_abort = 4;
43  }
44
45  // The percentage of requests/operations/connections that will be aborted with the error code
46  // provided.
47  type.FractionalPercent percentage = 3;
48}
49
50// [#next-free-field: 14]
51message HTTPFault {
52  // If specified, the filter will inject delays based on the values in the
53  // object.
54  filter.fault.v2.FaultDelay delay = 1;
55
56  // If specified, the filter will abort requests based on the values in
57  // the object. At least *abort* or *delay* must be specified.
58  FaultAbort abort = 2;
59
60  // Specifies the name of the (destination) upstream cluster that the
61  // filter should match on. Fault injection will be restricted to requests
62  // bound to the specific upstream cluster.
63  string upstream_cluster = 3;
64
65  // Specifies a set of headers that the filter should match on. The fault
66  // injection filter can be applied selectively to requests that match a set of
67  // headers specified in the fault filter config. The chances of actual fault
68  // injection further depend on the value of the :ref:`percentage
69  // <envoy_api_field_config.filter.http.fault.v2.FaultAbort.percentage>` field.
70  // The filter will check the request's headers against all the specified
71  // headers in the filter config. A match will happen if all the headers in the
72  // config are present in the request with the same values (or based on
73  // presence if the *value* field is not in the config).
74  repeated api.v2.route.HeaderMatcher headers = 4;
75
76  // Faults are injected for the specified list of downstream hosts. If this
77  // setting is not set, faults are injected for all downstream nodes.
78  // Downstream node name is taken from :ref:`the HTTP
79  // x-envoy-downstream-service-node
80  // <config_http_conn_man_headers_downstream-service-node>` header and compared
81  // against downstream_nodes list.
82  repeated string downstream_nodes = 5;
83
84  // The maximum number of faults that can be active at a single time via the configured fault
85  // filter. Note that because this setting can be overridden at the route level, it's possible
86  // for the number of active faults to be greater than this value (if injected via a different
87  // route). If not specified, defaults to unlimited. This setting can be overridden via
88  // `runtime <config_http_filters_fault_injection_runtime>` and any faults that are not injected
89  // due to overflow will be indicated via the `faults_overflow
90  // <config_http_filters_fault_injection_stats>` stat.
91  //
92  // .. attention::
93  //   Like other :ref:`circuit breakers <arch_overview_circuit_break>` in Envoy, this is a fuzzy
94  //   limit. It's possible for the number of active faults to rise slightly above the configured
95  //   amount due to the implementation details.
96  google.protobuf.UInt32Value max_active_faults = 6;
97
98  // The response rate limit to be applied to the response body of the stream. When configured,
99  // the percentage can be overridden by the :ref:`fault.http.rate_limit.response_percent
100  // <config_http_filters_fault_injection_runtime>` runtime key.
101  //
102  // .. attention::
103  //  This is a per-stream limit versus a connection level limit. This means that concurrent streams
104  //  will each get an independent limit.
105  filter.fault.v2.FaultRateLimit response_rate_limit = 7;
106
107  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
108  // runtime. The default is: fault.http.delay.fixed_delay_percent
109  string delay_percent_runtime = 8;
110
111  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
112  // runtime. The default is: fault.http.abort.abort_percent
113  string abort_percent_runtime = 9;
114
115  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
116  // runtime. The default is: fault.http.delay.fixed_duration_ms
117  string delay_duration_runtime = 10;
118
119  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
120  // runtime. The default is: fault.http.abort.http_status
121  string abort_http_status_runtime = 11;
122
123  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
124  // runtime. The default is: fault.http.max_active_faults
125  string max_active_faults_runtime = 12;
126
127  // The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
128  // runtime. The default is: fault.http.rate_limit.response_percent
129  string response_rate_limit_percent_runtime = 13;
130}
131