-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add HTTP headers for controlling percentage of requests faults should be applied to #10648
Description
Title:
Add support for HTTP headers controlling the percentage of requests Envoy injects faults into.
Context:
Envoy currently supports 3 types of faults it can ingest when it receives special HTTPs headers as part of ingress network requests. These HTTP headers are: x-envoy-fault-abort-request, x-envoy-fault-delay-request and x-envoy-fault-response-limit and their documentation can be found here. Envoy always ingests a fault when it sees one of the aforementioned HTTP headers. There is no way to tell Envoy what percentage of requests a given fault should be applied to.
Proposal
Add support for 3 additional HTTPs headers that would allow mobile applications talking with Envoy to tell Envoy what % of requests a given type of fault should be applied to:
| Header Being Proposed | Possible Values of Proposed Header | Corresponding Runtime Setting |
|---|---|---|
x-envoy-fault-abort-request-percentage |
int from (0, 100] Range |
fault.http.abort.abort_percent |
x-envoy-fault-delay-request-percentage |
int from (0, 100] Range |
fault.http.delay.fixed_delay_percent |
x-envoy-fault-response-limit-percentage |
int from (0, 100] Range |
fault.http.rate_limit.response_percent |
- Envoy will check the value of
x-envoy-fault-abort-request-percentageheader only ifx-envoy-fault-abort-requestis present. The same is true for other header pairs:x-envoy-fault-delay-request-percentageandx-envoy-fault-delay-requestx-envoy-fault-response-limit-percentageandx-envoy-fault-response-limit
- If a header responsible for providing
percentagevalue is not presentEnvoywill assume that the percentage is equal to 100. This approach makes the proposed API backward compatible.
Relevant Links
This EnvoyMobile Issue explains in detail why we cannot put 'percentage' logic on the client-side if our mobile application use EnvoyMobile networking library.