SLO Generator
Project description
SLO Generator
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 patternslo_*.yamlto be loaded. -
<ERROR_BUDGET_POLICY>is the Error Budget Policy file. -
--exportenables exporting data using theexportersdefined in the SLO configuration file.
Use slo-generator --help to list all available arguments.
Notes:
- To enable debug logs, set the environment variable
DEBUGto1. - To enable colorized output (local usage), set the environment variable
COLORED_OUTPUTto1.
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:
-
SLO metadata:
slo_name: Name of this SLO.slo_description: Description of this SLO.slo_target: SLO target (between 0 and 1).service_name: Name of the monitored service.feature_name: Name of the monitored subsystem.
-
SLI configuration:
backend: Specific documentation and examples are available for each supported backends:
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slo-generator-1.4.0.tar.gz.
File metadata
- Download URL: slo-generator-1.4.0.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
675e75c75a3c3812c74c65d140a1df56e268fc0eed24a529c790708296fd2bb8
|
|
| MD5 |
85b202ac0b77f29f1b83055207ac307a
|
|
| BLAKE2b-256 |
cb346eab5fa1a956399e60d711b525b2cc8993b5cbbf310a5464c0d78d8d99a0
|
File details
Details for the file slo_generator-1.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: slo_generator-1.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 60.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5ca65e603f8731b8002f5a0b1dea330bddeed1f4e888d99c7b5220d7eb5dc95
|
|
| MD5 |
32db54c08657db242ab81eb8a2c2b10e
|
|
| BLAKE2b-256 |
fbbaa377c8bd853f6f7539ed26b6953f66b9fc0a8260dd6387d44eddd0c8684e
|