@@ -178,7 +178,7 @@ new incident.AlertRoute("HoneycombAlertRoute", {
178178 reference : $interpolate `alert.attributes.${ fields . product . id } ` ,
179179 } ,
180180 ] ,
181- groupingWindowSeconds : 900 ,
181+ groupingWindowSeconds : 3600 ,
182182 } ,
183183 incidentTemplate : {
184184 name : {
@@ -215,7 +215,6 @@ type Trigger = (opts: { model: string; product: Product }) => {
215215 description : string
216216 json : honeycomb . GetQuerySpecificationOutputArgs
217217 threshold : { op : ">=" | "<=" ; value : number }
218- baseline : 3600 | 86400
219218}
220219
221220type Model = { id : string ; products : Product [ ] ; triggers : Trigger [ ] }
@@ -232,6 +231,8 @@ const httpErrors: Trigger = ({ model, product }) => ({
232231 filterCombination : "AND" ,
233232 filters : [
234233 { column : "model" , op : "=" , value : model } ,
234+ { column : "event_type" , op : "=" , value : "completions" } ,
235+ { column : "user_agent" , op : "contains" , value : "opencode" } ,
235236 { column : "isGoTier" , op : "=" , value : product === "go" ? "true" : "false" } ,
236237 ] ,
237238 } ,
@@ -241,6 +242,8 @@ const httpErrors: Trigger = ({ model, product }) => ({
241242 filterCombination : "AND" ,
242243 filters : [
243244 { column : "model" , op : "=" , value : model } ,
245+ { column : "event_type" , op : "=" , value : "completions" } ,
246+ { column : "user_agent" , op : "contains" , value : "opencode" } ,
244247 { column : "isGoTier" , op : "=" , value : product === "go" ? "true" : "false" } ,
245248 { column : "status" , op : ">=" , value : "400" } ,
246249 { column : "status" , op : "!=" , value : "401" } ,
@@ -250,10 +253,7 @@ const httpErrors: Trigger = ({ model, product }) => ({
250253 formulas : [ { name : "ERROR" , expression : "$FAILED / $TOTAL" } ] ,
251254 timeRange : 900 ,
252255 } ,
253- // Alert when errors surge 50% compared to the previous period
254- threshold : { op : ">=" , value : 50 } ,
255- // What previous time period to evaluate against
256- baseline : 3600 ,
256+ threshold : { op : ">=" , value : 0.8 } ,
257257} )
258258
259259const models : Model [ ] = [
@@ -296,10 +296,8 @@ for (const model of models) {
296296 name : spec . title ,
297297 description : spec . description ,
298298 queryJson : honeycomb . getQuerySpecificationOutput ( spec . json ) . json ,
299- alertType : "on_change" ,
300- // This is the minimum when using % change detection
301- frequency : 900 ,
302- baselineDetails : [ { type : "percentage" , offsetMinutes : spec . baseline / 60 } ] ,
299+ alertType : "on_true" ,
300+ frequency : 300 ,
303301 thresholds : [ { ...spec . threshold , exceededLimit : 1 } ] ,
304302 recipients : [
305303 {
0 commit comments