Skip to content

Commit

Permalink
feat: add api gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpuiggarcia committed Sep 3, 2023
1 parent 4d4c379 commit 1afd5f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcp/cloud-alerts/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ resource "google_monitoring_alert_policy" "error_rate_alert" {
display_name = "5xx Errors"

condition_threshold {
filter = "resource.type=\"cloud_run_revision\" AND metric.type=\"run.googleapis.com/request_count\" AND metric.response_code_class=\"5xx\" AND resource.service_name=\"${var.service_name}\""
filter = "resource.type=\"cloud_run_revision\" AND metric.type=\"run.googleapis.com/request_count\" AND response_code_class=\"5xx\" AND resource.labels.service_name=\"${var.service_name}\""


comparison = "COMPARISON_GT"
threshold_value = var.error_rate_threshold
Expand All @@ -35,7 +36,7 @@ resource "google_monitoring_alert_policy" "latency_alert" {
display_name = "High Latency"

condition_threshold {
filter = "resource.type=\"cloud_run_revision\" AND metric.type=\"run.googleapis.com/request_latencies\" AND resource.service_name=\"${var.service_name}\""
filter = "resource.type=\"cloud_run_revision\" AND metric.type=\"run.googleapis.com/request_latencies\" AND resource.labels.service_name=\"${var.service_name}\""

comparison = "COMPARISON_GT"
threshold_value = var.latency_threshold
Expand Down

0 comments on commit 1afd5f8

Please sign in to comment.