1syntax = "proto3";
2
3package envoy.extensions.filters.common.fault.v3;
4
5import "envoy/type/v3/percent.proto";
6
7import "google/protobuf/duration.proto";
8
9import "udpa/annotations/status.proto";
10import "udpa/annotations/versioning.proto";
11import "validate/validate.proto";
12
13option java_package = "io.envoyproxy.envoy.extensions.filters.common.fault.v3";
14option java_outer_classname = "FaultProto";
15option java_multiple_files = true;
16option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/fault/v3;faultv3";
17option (udpa.annotations.file_status).package_version_status = ACTIVE;
18
19// [#protodoc-title: Common fault injection types]
20
21// Delay specification is used to inject latency into the
22// HTTP/Mongo operation.
23// [#next-free-field: 6]
24message FaultDelay {
25  option (udpa.annotations.versioning).previous_message_type =
26      "envoy.config.filter.fault.v2.FaultDelay";
27
28  enum FaultDelayType {
29    // Unused and deprecated.
30    FIXED = 0;
31  }
32
33  // Fault delays are controlled via an HTTP header (if applicable). See the
34  // :ref:`HTTP fault filter <config_http_filters_fault_injection_http_header>` documentation for
35  // more information.
36  message HeaderDelay {
37    option (udpa.annotations.versioning).previous_message_type =
38        "envoy.config.filter.fault.v2.FaultDelay.HeaderDelay";
39  }
40
41  reserved 2, 1;
42
43  reserved "type";
44
45  oneof fault_delay_secifier {
46    option (validate.required) = true;
47
48    // Add a fixed delay before forwarding the operation upstream. See
49    // https://developers.google.com/protocol-buffers/docs/proto3#json for
50    // the JSON/YAML Duration mapping. For HTTP/Mongo, the specified
51    // delay will be injected before a new request/operation.
52    // This is required if type is FIXED.
53    google.protobuf.Duration fixed_delay = 3 [(validate.rules).duration = {gt {}}];
54
55    // Fault delays are controlled via an HTTP header (if applicable).
56    HeaderDelay header_delay = 5;
57  }
58
59  // The percentage of operations/connections/requests on which the delay will be injected.
60  type.v3.FractionalPercent percentage = 4;
61}
62
63// Describes a rate limit to be applied.
64message FaultRateLimit {
65  option (udpa.annotations.versioning).previous_message_type =
66      "envoy.config.filter.fault.v2.FaultRateLimit";
67
68  // Describes a fixed/constant rate limit.
69  message FixedLimit {
70    option (udpa.annotations.versioning).previous_message_type =
71        "envoy.config.filter.fault.v2.FaultRateLimit.FixedLimit";
72
73    // The limit supplied in KiB/s.
74    uint64 limit_kbps = 1 [(validate.rules).uint64 = {gte: 1}];
75  }
76
77  // Rate limits are controlled via an HTTP header (if applicable). See the
78  // :ref:`HTTP fault filter <config_http_filters_fault_injection_http_header>` documentation for
79  // more information.
80  message HeaderLimit {
81    option (udpa.annotations.versioning).previous_message_type =
82        "envoy.config.filter.fault.v2.FaultRateLimit.HeaderLimit";
83  }
84
85  oneof limit_type {
86    option (validate.required) = true;
87
88    // A fixed rate limit.
89    FixedLimit fixed_limit = 1;
90
91    // Rate limits are controlled via an HTTP header (if applicable).
92    HeaderLimit header_limit = 3;
93  }
94
95  // The percentage of operations/connections/requests on which the rate limit will be injected.
96  type.v3.FractionalPercent percentage = 2;
97}
98