Fault injection filter

    Sandbox environment

    Setup your sandbox environment with Docker and Docker Compose, and clone the Envoy repository with Git.

    This simple example demonstrates Envoy’s capability using Envoy’s runtime support to control the feature.

    It demonstrates fault injection that cause the request to abort and fail, and also faults that simply delay the response.

    Change to the directory.

    Terminal 1

    Terminal 2

    1. $ pwd
    2. envoy/examples/fault-injection

    The script above () sends a continuous stream of HTTP requests to Envoy, which in turn forwards the requests to the backend container.

    Consequently, you should see a continuous sequence of HTTP 200 response codes.

    Turn on abort fault injection via the runtime using the commands below.

    Terminal 3

    The script above enables HTTP aborts for 100% of requests.

    You should now see a continuous sequence of HTTP 503 responses for all requests.

    To disable the abort injection:

    Terminal 3

    Turn on delay fault injection via the runtime using the commands below.

    The script above will add a 3-second delay to 50% of HTTP requests.

    You should now see a continuous sequence of HTTP 200 responses for all requests, but half of the requests will take 3 seconds to complete.

    To disable the delay injection:

    Terminal 3

    1. $ bash disable_delay_fault_injection.sh

    To see the current runtime filesystem overview:

    Terminal 3

    See also

    Fault injection