Status Check in Workflow

note

Chaos Mesh does not yet support creating StatusCheck nodes on Chaos Dashboard, so you could only create StatusCheck nodes using YAML for now.

Chaos Mesh only support the HTTP type to execute a status check.

A StatusCheck node sends GET or POST HTTP requests to the specific URL, with custom headers and body, and then determines the result of the request by the conditions in the criteria field.

In the configuration, you can see a StatusCheck node with HTTP type. The deadline field specifies that this node could be executed for a maximum of 20 seconds. The mode field specifies that this node will execute status checks continuously. The intervalSeconds field specifies a repetition interval of 1 second. The timeoutSeconds field specifies the timeout for each execution.

When Workflow runs to this StatusCheck node, the specified status check would be executed every second. The status check uses the GET method to send an HTTP request to the URL http://123.123.123.123. If the response is returned within 1 second and the status code is 200, this execution succeeds, otherwise it fails.

The StatusCheck node has failureThreshold and successThreshold two fields:

  • When the number of consecutive failed execution results exceeds the failureThreshold, the status check result is considered to be a Failure.
  • When the number of consecutive successful execution results exceeds the successThreshold, the is considered to be a Success.

In the configuration, the StatusCheck node will execute status checks continuously:

  • When the execution result is Success for 1 or more consecutive times, the status check result is considered to be a Success.
  • When the execution result is Failure for 3 or more consecutive times, the status check result is considered to be a Failure.
note

In the following sections, status check fails refers to that status check result is Failure, rather than a single execution result is Failure.

When the Status Check is unsuccessful, abort the Workflow

note

The StatusCheck node only supports aborting the workflow automatically when the status check is unsuccessful. It could not pause or resume the workflow.

When executing chaos experiments, the application system might become unhealthy, this function can be used to restore the application system by quickly ending chaos experiments. To enable the workflow to abort automatically when the status check fails, you can set the abortWithStatusCheck field to true on the StatusCheck node.

  • When the StatusCheck node timeout is exceeded, and the status check result is not successful. For example, successThreshold is 1, failureThreshold is 3, and when the timeout is exceeded, there are 2 consecutive failures and 0 successes. Although it does not meet the condition for “status check fails”, it is also considered to be unsuccessful in this case.

When the mode field is Continuous, it means this StatusCheck node will execute status checks continuously until the node times out or the status check fails.

In the configuration, the StatusCheck node will execute status checks every second, and exit when any of the following conditions are met:

  • The status check fails, i.e. 3 or more consecutive failed execution results
  • Trigger the node timeout after 20 seconds

One time Status Check

When the mode field is Synchronous, it means that this StatusCheck node will exit immediately when the status check result is clear, or when the node times out.

In the configuration, the StatusCheck node will execute status checks every second, and exit when any of the following conditions are met:

  • The status check succeeds, i.e. 1 or more consecutive successful execution results
  • The status check fails, i.e. 3 or more consecutive failed execution results
  • Trigger the node timeout after 20 seconds

Similarities:

  • The node and the HTTP Request Task node (the Task node that executes HTTP requests) are a node type of Workflow.
  • The StatusCheck node and the HTTP Request Task node can obtain information about external systems through HTTP requests.
  • The HTTP Request Task node could only send an HTTP once, and cannot send HTTP requests continuously.

For more information about Workflow and Template, refer to Create Chaos Mesh Workflow.

HTTPStatusCheck field description