These terraform examples make it easy to deploy SLOs in your Google Cloud Environment with Cloud Monitoring.
- This is not an officially supported Google product.
- Proper testing should be done before running this tool in production.
This sample code is made available under Apache 2 license. See the LICENSE file for more details.
This repository contains terraform templates to:
- Create Service Level Indicators/Service Level Objectives (SLI/SLO) using the Google Cloud Operations Suite on Google Cloud Platform
- Create Alerting policies for tracking and alerting on Error Budget Burns
- Create Notification channels to various tools (email, mobile, webhook etc.) to deliver the alerts generated
- Clone the Notification Channels templates into a folder with the following structure:
Notification Channels/
├── main.tf
└── variables.tf
- Edit the variables in
variables.tf
- Deploy via terraform
Note: Notification channels currently support email. Support for other channels coming soon.
Currently this repository contains examples to create 3 types of SLI/SLO:
- Basic - These correspond to SLIs that can be created for certain native Google Cloud products including App Engine, GKE, Cloud Run and Istio. These require minimal configuration and are ideal if your service leverage these products.
- Request Based - These SLIs use a count of the good and total events to compute SLIs. The degree of specificity that the user can employ is higher than that of Basic SLIs thus enabling the user to fine tune the dimensions of the SLI.
- Window Based - These SLIs use the number of windows in a measurement period, during which the metric was compliant with the target, in the SLI/SLO calculation. These windows could be any length (from 1 second to 1 day).
Steps to create SLI/SLO:
- Clone the relevant SLI template folder (basic, request-based, window-based) with the following structure:
<SLI Name>/
├── main.tf
└── variables.tf
for example,
Availability for Login/
├── main.tf
└── variables.tf
- Edit the variables in
variables.tf
- Deploy via terraform
- Clone the Alerting Policies template with the following structure:
<Alerting Policy Name>/
├── main.tf
└── variables.tf
for example,
Alert - 10% burn - Availability for Login/
├── main.tf
└── variables.tf
- Edit the variables in
variables.tf
- Deploy via terraform