Scenarios

Scenarios are a way to test your infrastructure. They are composed of steps that are executed in a specific order. They can be used to test your infrastructure, to test your application, to generate metrics of your uptime, to loadtest your application, or to test your infrastructure and your application.

Hidra scenarios allow you to generate tests of different types in a very easy way, all tests are defined by simple tests using YAML. In this section, you will find the different types of tests you can do with Hidra.

Monitoring

Each time a scenario is run, it checks that all conditions are met, if the conditions are not met it will generate a metric with error. In addition, Hidra stores the execution times of each scenario, for HTTP scenarios this is very useful. On the other hand, each step is able to generate its own metrics.

Configuration

The Hidra scenarios accept the following parameters:

OptionDescriptionValue typeDefaultSince
nameWhat name you want to give to the scenario.string
descriptionWhat description you want to give to the scenario.boolfalse
scrapeIntervalIn agent mode, how often to run the scenario.int0
scenarioThe definition of the scenarioobjectfalse
tagsTags to add to the scenario exposed as prometheus labelsmap[string]string{}v2.1.0
To configure the scenario itself, you will need to configure the following:
OptionDescriptionValue typeDefaultSince
kindHidra accepts different types of scenarios, you can specify them here. Check out the rest of the sections.string
stepsAll the steps you have to execute this scenario.array[]

To configure the steps, each step must contain the following:

OptionDescriptionValue typeDefaultSince
typeStep type inside scenario contextstring
paramsParams for given step.object{}
negateIf you want to check that step condition is not okboolfalse
timeoutThe maximum time to run the scenarioint0v2.1.0

All this, in YAML format, would look like this:

name: http_basic_example
description: Test that example.com return HTTP 200
scrapeInterval: 1m
scenario:
kind: http
steps:
    - type: request
    params:
        url: "https://example.org/"
    - type: statusCodeShouldBe
    params:
        statusCode: "200"

Last modified March 1, 2022: add description to docs (ac92a1a)