From 468eb68878974f555ae2a03575d52d716f26e029 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 17 May 2026 13:15:37 -0400 Subject: [PATCH] zen: update monitoring query --- infra/monitoring.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/infra/monitoring.ts b/infra/monitoring.ts index 660091b30d..b30b34dd0b 100644 --- a/infra/monitoring.ts +++ b/infra/monitoring.ts @@ -46,10 +46,24 @@ const modelHttpErrorsQuery = (product: "go" | "zen") => { ] const failedHttpStatus = calculatedField({ name: "is_failed_http_status", - expression: - product === "go" - ? `IF(AND(GTE($status, "400"), NOT(EQUALS($status, "401")), NOT(EQUALS($status, "429"))), 1, 0)` - : `IF(AND(EQUALS($status, "429"), $isFreeTier), 0, AND(GTE($status, "400"), NOT(EQUALS($status, "401"))), 1, 0)`, + expression: ` +IF( + AND( + GTE($status, "400"), + NOT(EQUALS($status, "401")), + NOT( + AND( + EQUALS($status, "429"), + OR( + EQUALS($error.type, "GoUsageLimitError"), + EQUALS($error.type, "FreeUsageLimitError") + ) + ) + ) + ), + 1, + 0 +)`, }) return honeycomb.getQuerySpecificationOutput({