Creating a Multi-Experiment Report

In this lesson, we will be running another chaos experiment to generate another journal. Then, the two journals will be used to generate a multi-experiment report.

Assuming that we want to see how we can generate reports based on multiple experiments, the first thing we need to do is to run a second experiment. Otherwise, we’d be left with data (journal) from a single experiment.

So, we are going to execute yet another experiment that will generate a second journal file. After that, we’ll try to figure out how to create a report based on both journals.

Using the definition of network-delay.yaml#

Let’s start by taking a quick look at yet another definition.

The output is as follows.

version1.0.0
titleWhat happens if we abort and delay responses
descriptionIf responses are aborted and delayed, the dependant application should retry and/or timeout requests
tags:
k8s
istio
http
configuration:
  ingress_host:
      typeenv
      keyINGRESS_HOST
steady-state-hypothesis:
  titleThe app is healthy
  probes:
  - typeprobe
    nameapp-responds-to-requests
    tolerance200
    provider:
      typehttp
      timeout15
      verify_tlsfalse
      urlhttp://${ingress_host}?addr=http://go-demo-8
      headers:
        Hostrepeater.acme.com
  - typeprobe
    tolerance200
    refapp-responds-to-requests
  - typeprobe
    tolerance200
    refapp-responds-to-requests
  - typeprobe
    tolerance200
    refapp-responds-to-requests
  - typeprobe
    tolerance200
    refapp-responds-to-requests
method:
typeaction
  nameabort-failure
  provider:
    typepython
    modulechaosistio.fault.actions
    funcadd_abort_fault
    arguments:
      virtual_service_namego-demo-8
      http_status500
      routes:
        - destination:
            hostgo-demo-8
            subsetprimary
      percentage50
      versionnetworking.istio.io/v1alpha3
      nsgo-demo-8
typeaction
  namedelay
  provider:
    typepython
    modulechaosistio.fault.actions
    funcadd_delay_fault
    arguments:
      virtual_service_namego-demo-8
      fixed_delay15s
      routes:
        - destination:
            hostgo-demo-8
            subsetprimary
      percentage50
      versionnetworking.istio.io/v1alpha3
      nsgo-demo-8
  pauses
    after1
rollbacks:
typeaction
  nameremove-abort-failure
  provider:
    typepython
    funcremove_abort_fault
    modulechaosistio.fault.actions
    arguments:
      virtual_service_namego-demo-8
      routes:
        - destination:
            hostgo-demo-8
            subsetprimary
      versionnetworking.istio.io/v1alpha3
      nsgo-demo-8
typeaction
  nameremove-delay
  provider:
    typepython
    funcremove_delay_fault
    modulechaosistio.fault.actions
    arguments:
      virtual_service_namego-demo-8
      routes:
        - destination:
            hostgo-demo-8
            subsetprimary
      versionnetworking.istio.io/v1alpha3
      nsgo-demo-8

That is the same experiment as one of those we ran while we were experimenting with networking. There’s nothing new here.

Running the experiment with the --journal-path argument#

We are reusing the experiment we’re familiar with, so I’ll skip explaining what that does. Instead, we’ll jump straight into running it.

The output, without timestamps, is as follows.

[... INFO] Validating the experiment's syntax
[... INFO] Experiment looks valid
[... INFO] Running experiment: What happens if we abort and delay responses
[... INFO] Steady state hypothesis: The app is healthy
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Steady state hypothesis is met!
[... INFO] Action: abort-failure
[... INFO] Action: delay
[... INFO] Pausing after activity for 1s...
[... INFO] Steady state hypothesis: The app is healthy
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Probe: app-responds-to-requests
[... INFO] Steady state hypothesis is met!
[... INFO] Let's rollback...
[... INFO] Rollback: remove-abort-failure
[... INFO] Action: remove-abort-failure
[... INFO] Rollback: remove-delay
[... INFO] Action: remove-delay
[... INFO] Experiment ended with status: completed

The experiment was successful, and you already know what it does. Even if your memory does not serve you well, you should be able to deduce what it’s about by reading the definition and comparing it with the outcome of the execution. What matters is that we stored the result in a different journal file.

Creating the Docker container and generating the report#

Let’s run another container to generate a report.

We created a container with almost the same arguments. The only difference is that we added the path to the second journal file (journal-network-delay.json).

We can generate a report based on as many experiments as we want, as long as each produces a different journal file. All we have to do is specify all those journals as arguments. It’s up to Chaos Toolkit to assemble the information from all the specified experiments and create a report.

Inspecting the generated report#

Let’s take a look at the report.

We can see that this time, the report contains the outcomes from both experiments.

As long as we store the results of each experiment in a separate journal file, we can combine them all into one big report and distribute it to whoever is interested.


In the next lesson, we will remove the resources that we have created.

Creating Experiment Report
Destroying What We Created
Mark as Completed
Report an Issue