From 2825522844110189e7f6cffefb39c8d369756022 Mon Sep 17 00:00:00 2001 From: Jamil Date: Sat, 2 Nov 2024 15:43:49 -0700 Subject: [PATCH] fix(infra): Filter out WebSocket upgrade from latency alerting (#7242) --- terraform/modules/google-cloud/ops/main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/modules/google-cloud/ops/main.tf b/terraform/modules/google-cloud/ops/main.tf index 8d5515072..d99a5cdd0 100644 --- a/terraform/modules/google-cloud/ops/main.tf +++ b/terraform/modules/google-cloud/ops/main.tf @@ -431,7 +431,8 @@ resource "google_monitoring_alert_policy" "load_balancer_latency_policy" { display_name = "Load balancer latency" condition_threshold { - filter = "resource.type = \"https_lb_rule\" AND metric.type = \"loadbalancing.googleapis.com/https/backend_latencies\"" + # Filter out HTTP 101 responses (switching protocols) to prevent WebSocket connections from triggering the alert + filter = "metric.labels.response_code != \"101\" AND resource.type = \"https_lb_rule\" AND metric.type = \"loadbalancing.googleapis.com/https/backend_latencies\"" comparison = "COMPARISON_GT" threshold_value = 1000 duration = "0s"