Skip to content

Commit 468eb68

Browse files
committed
zen: update monitoring query
1 parent 23b594d commit 468eb68

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

infra/monitoring.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,24 @@ const modelHttpErrorsQuery = (product: "go" | "zen") => {
4646
]
4747
const failedHttpStatus = calculatedField({
4848
name: "is_failed_http_status",
49-
expression:
50-
product === "go"
51-
? `IF(AND(GTE($status, "400"), NOT(EQUALS($status, "401")), NOT(EQUALS($status, "429"))), 1, 0)`
52-
: `IF(AND(EQUALS($status, "429"), $isFreeTier), 0, AND(GTE($status, "400"), NOT(EQUALS($status, "401"))), 1, 0)`,
49+
expression: `
50+
IF(
51+
AND(
52+
GTE($status, "400"),
53+
NOT(EQUALS($status, "401")),
54+
NOT(
55+
AND(
56+
EQUALS($status, "429"),
57+
OR(
58+
EQUALS($error.type, "GoUsageLimitError"),
59+
EQUALS($error.type, "FreeUsageLimitError")
60+
)
61+
)
62+
)
63+
),
64+
1,
65+
0
66+
)`,
5367
})
5468

5569
return honeycomb.getQuerySpecificationOutput({

0 commit comments

Comments
 (0)