| 130 | } |
| 131 | |
| 132 | const modelLowTpsQuery = (product: "go" | "zen") => { |
| 133 | const filters = [ |
| 134 | { column: "model", op: "exists" }, |
| 135 | { column: "event_type", op: "=", value: "completions" }, |
| 136 | { column: "user_agent", op: "contains", value: "opencode" }, |
| 137 | { column: "isGoTier", op: "=", value: product === "go" ? "true" : "false" }, |
| 138 | { column: "status", op: ">=", value: "200" }, |
| 139 | { column: "status", op: "<", value: "400" }, |
| 140 | { column: "tps.output", op: "exists" }, |
| 141 | ] |
| 142 | |
| 143 | return honeycombio.getQuerySpecificationOutput({ |
| 144 | breakdowns: ["model"], |
| 145 | calculations: [ |
| 146 | { op: "COUNT", name: "TOTAL", filterCombination: "AND", filters }, |
| 147 | { |
| 148 | op: "P50", |
| 149 | name: "TPS", |
| 150 | column: "tps.output", |
| 151 | filterCombination: "AND", |
| 152 | filters, |
| 153 | }, |
| 154 | ], |
| 155 | formulas: [{ name: "LOW_TPS", expression: "IF(GTE($TOTAL, 100), $TPS, 999)" }], |
| 156 | timeRange: 1800, |
| 157 | }).json |
| 158 | } |
| 159 | |
| 160 | new honeycombio.Trigger("IncreasedModelHttpErrorsGo", { |
| 161 | name: "Increased Model HTTP Errors [Go]", |