Skip to main content

SLO Generator

Project description

SLO Generator

build cloudbuild PyPI version

slo-generator is a tool to compute and export Service Level Objectives (SLOs), Error Budgets and Burn Rates, using policies written in JSON or YAML format.

Description

slo-generator will query metrics backend and compute the following metrics:

  • Service Level Objective defined as SLO (%) = GOOD_EVENTS / VALID_EVENTS
  • Error Budget defined as ERROR_BUDGET = 100 - SLO (%)
  • Burn Rate defined as BURN_RATE = ERROR_BUDGET / ERROR_BUDGET_TARGET

Local usage

Requirements

  • Python 3

Installation

slo-generator is published on PyPI. To install it, run:

pip3 install slo-generator

Run the slo-generator

slo-generator -f <SLO_CONFIG_PATH> -b <ERROR_BUDGET_POLICY> --export
  • <SLO_CONFIG_PATH> is the SLO config file or folder. If a folder path is passed, the SLO configs filenames should match the pattern slo_*.yaml to be loaded.

  • <ERROR_BUDGET_POLICY> is the Error Budget Policy file.

  • --export enables exporting data using the exporters defined in the SLO configuration file.

Use slo-generator --help to list all available arguments.

Notes:

  • To enable debug logs, set the environment variable DEBUG to 1.
  • To enable colorized output (local usage), set the environment variable COLORED_OUTPUT to 1.

Configuration

The slo-generator requires two configuration files to run, the SLO configuration file and the Error budget policy file.

SLO configuration

The SLO configuration (JSON or YAML) is composed of the following fields:

  • Exporter configuration:
    • exporters: A list of exporters to export results to. Specific documentation is available for each supported exporters:
      • Cloud Pub/Sub to stream SLO reports.
      • BigQuery to export SLO reports to BigQuery for historical analysis and DataStudio reporting.
      • Stackdriver Monitoring to export metrics to Stackdriver Monitoring.
      • Prometheus to export metrics to Prometheus.
      • Datadog to export metrics to Datadog.
      • Dynatrace to export metrics to Dynatrace.
      • Custom to export SLO data or metrics to a custom destination.

Note: you can use environment variables in your SLO configs by using ${MY_ENV_VAR} syntax to avoid having sensitive data in version control. Environment variables will be replaced at run time.

==> An example SLO configuration file is available here.

Error Budget policy

The Error Budget policy (JSON or YAML) is a list of multiple error budgets, each one composed of the following fields:

  • window: Rolling time window for this error budget.
  • alerting_burn_rate_threshold: Target burnrate threshold over which alerting is needed.
  • urgent_notification: boolean whether violating this error budget should trigger a page.
  • overburned_consequence_message: message to show when the error budget is above the target.
  • achieved_consequence_message: message to show when the error budget is within the target.

==> An example Error Budget policy is available here.

More documentation

To go further with the SLO Generator, you can read:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slo-generator-1.3.1.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slo_generator-1.3.1-py2.py3-none-any.whl (58.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file slo-generator-1.3.1.tar.gz.

File metadata

  • Download URL: slo-generator-1.3.1.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for slo-generator-1.3.1.tar.gz
Algorithm Hash digest
SHA256 3c83af561111d9f42986cae80d6f74b576b5d6b0c3819ebd5b878c1774412c74
MD5 df4f129ebcba141364225fcaf8e60cee
BLAKE2b-256 123a96a5c573dc6b1c9ef99187e7e17e744a5dbbeaaebc8a14ba8814276001b7

See more details on using hashes here.

File details

Details for the file slo_generator-1.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: slo_generator-1.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 58.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for slo_generator-1.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ef82f650ae7ec0f5856effd2c27227f0e262fb2273f4d6d1c5e5537f8282329d
MD5 497b4c4c9512c84392b6ddb6845da753
BLAKE2b-256 166cf3c91a125c74c4b35978426bedc5d886258f633ea690ea85b364651254b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page