@@ -111,6 +111,34 @@ const providerHttpErrorsQuery = (product: "go" | "zen") => {
111111 } ) . json
112112}
113113
114+ const modelLowTpsQuery = ( product : "go" | "zen" ) => {
115+ const filters = [
116+ { column : "model" , op : "exists" } ,
117+ { column : "event_type" , op : "=" , value : "completions" } ,
118+ { column : "user_agent" , op : "contains" , value : "opencode" } ,
119+ { column : "isGoTier" , op : "=" , value : product === "go" ? "true" : "false" } ,
120+ { column : "status" , op : ">=" , value : "200" } ,
121+ { column : "status" , op : "<" , value : "400" } ,
122+ { column : "tps.output" , op : "exists" } ,
123+ ]
124+
125+ return honeycomb . getQuerySpecificationOutput ( {
126+ breakdowns : [ "model" ] ,
127+ calculations : [
128+ { op : "COUNT" , name : "TOTAL" , filterCombination : "AND" , filters } ,
129+ {
130+ op : "P50" ,
131+ name : "TPS" ,
132+ column : "tps.output" ,
133+ filterCombination : "AND" ,
134+ filters,
135+ } ,
136+ ] ,
137+ formulas : [ { name : "LOW_TPS" , expression : "IF(GTE($TOTAL, 100), $TPS, 999)" } ] ,
138+ timeRange : 900 ,
139+ } ) . json
140+ }
141+
114142new honeycomb . Trigger ( "IncreasedModelHttpErrorsGo" , {
115143 name : "Increased Model HTTP Errors [Go]" ,
116144 description,
@@ -149,6 +177,46 @@ new honeycomb.Trigger("IncreasedModelHttpErrorsZen", {
149177 ] ,
150178} )
151179
180+ new honeycomb . Trigger ( "LowModelTpsGo" , {
181+ disabled : true ,
182+ name : "Low Model TPS [Go]" ,
183+ description,
184+ queryJson : modelLowTpsQuery ( "go" ) ,
185+ alertType : "on_change" ,
186+ frequency : 300 ,
187+ thresholds : [ { op : "<" , value : 20 , exceededLimit : 1 } ] ,
188+ recipients : [
189+ {
190+ id : webhookRecipient . id ,
191+ notificationDetails : [
192+ {
193+ variables : [ { name : "type" , value : "model_low_tps" } ] ,
194+ } ,
195+ ] ,
196+ } ,
197+ ] ,
198+ } )
199+
200+ new honeycomb . Trigger ( "LowModelTpsZen" , {
201+ disabled : true ,
202+ name : "Low Model TPS [Zen]" ,
203+ description,
204+ queryJson : modelLowTpsQuery ( "zen" ) ,
205+ alertType : "on_change" ,
206+ frequency : 300 ,
207+ thresholds : [ { op : "<" , value : 20 , exceededLimit : 1 } ] ,
208+ recipients : [
209+ {
210+ id : webhookRecipient . id ,
211+ notificationDetails : [
212+ {
213+ variables : [ { name : "type" , value : "model_low_tps" } ] ,
214+ } ,
215+ ] ,
216+ } ,
217+ ] ,
218+ } )
219+
152220new honeycomb . Trigger ( "IncreasedProviderHttpErrorsGo" , {
153221 name : "Increased Provider HTTP Errors [Go]" ,
154222 description,
0 commit comments