Skip to content

Instantly share code, notes, and snippets.

@yuriatgoogle
Created August 31, 2020 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriatgoogle/fcf29d7a101091182d68cbda371383c7 to your computer and use it in GitHub Desktop.
Save yuriatgoogle/fcf29d7a101091182d68cbda371383c7 to your computer and use it in GitHub Desktop.
resource "google_monitoring_slo" "request_based_slo" {
# the basics
service = google_monitoring_custom_service.terraform-service.service_id
slo_id = "request-slo"
display_name = "99% of requests are successful in a rolling day"
# the SLI
request_based_sli {
good_total_ratio {
total_service_filter = join(" AND ", [
"metric.type=\"external.googleapis.com/prometheus/request_count\"",
"resource.type=\"k8s_container\"",
"resource.label.\"container_name\"=\"opentelemetry-server\""
])
bad_service_filter = join(" AND ", [
"metric.type=\"external.googleapis.com/prometheus/error_count\"",
"resource.type=\"k8s_container\"",
"resource.label.\"container_name\"=\"opentelemetry-server\""
])
}
}
# the goal
goal = 0.99
rolling_period_days = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment