probeslo

compute_slo

Computes the given SLO and return a list of outcomes for each error budget given policies.

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosreliably.activities.slo.probes
Namecompute_slo
Returnlist

Usage

JSON

{
  "name": "compute-slo",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosreliably.activities.slo.probes",
    "func": "compute_slo",
    "arguments": {
      "slo": {},
      "config": {}
    }
  }
}

YAML

name: compute-slo
provider:
  arguments:
    config: {}
    slo: {}
  func: compute_slo
  module: chaosreliably.activities.slo.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
slomappingYesSLO ConfigurationSLO configuration as per https://github.com/google/slo-generator#slo-configuration
slomappingYesSLI Backend ConfigurationBackend configuration to read SLI from as per https://github.com/google/slo-generator#shared-configuration

Computes the given SLO and return a list of outcomes for each error budget policies in the config.

This is a wrapper around https://github.com/google/slo-generator so all of its documentation applies for the definition of the slo and config objects. The former contains the the SLO description while the latter describes where to source SLIs from and the error budget policies.

The most notable difference is that we disable any exporters so there is no need to define them.

Signature

def compute_slo(
        slo: Dict[str, Any],
        config: Dict[str, Any],
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> List[Dict[str, Any]]:
    pass