@@ -2,6 +2,7 @@ import { SECRET } from "./secret"
22import { domain } from "./stage"
33
44const description = "Managed by SST (Don't edit in Honeycomb UI)"
5+ const alertsDisabled = $app . stage !== "production"
56
67const webhookRecipient = new honeycomb . WebhookRecipient ( "DiscordAlerts" , {
78 name : $app . stage === "production" ? "Discord Alerts" : `Discord Alerts (${ $app . stage } )` ,
7980 filters,
8081 } ,
8182 ] ,
82- formulas : [ { name : "ERROR" , expression : "IF(GTE($TOTAL, 200 ), DIV($FAILED, $TOTAL), 0)" } ] ,
83+ formulas : [ { name : "ERROR" , expression : "IF(GTE($TOTAL, 150 ), DIV($FAILED, $TOTAL), 0)" } ] ,
8384 timeRange : 900 ,
8485 } ) . json
8586}
@@ -122,7 +123,7 @@ const providerHttpErrorsQuery = () => {
122123 } ,
123124 ] ,
124125 formulas : [
125- { name : "ERROR" , expression : "IF(GTE(SUM($SUCCESS, $FAILED), 200 ), DIV($FAILED, SUM($SUCCESS, $FAILED)), 0)" } ,
126+ { name : "ERROR" , expression : "IF(GTE(SUM($SUCCESS, $FAILED), 150 ), DIV($FAILED, SUM($SUCCESS, $FAILED)), 0)" } ,
126127 ] ,
127128 timeRange : 900 ,
128129 } ) . json
@@ -159,6 +160,7 @@ const modelLowTpsQuery = (product: "go" | "zen") => {
159160new honeycomb . Trigger ( "IncreasedModelHttpErrorsGo" , {
160161 name : "Increased Model HTTP Errors [Go]" ,
161162 description,
163+ disabled : alertsDisabled ,
162164 queryJson : modelHttpErrorsQuery ( "go" ) ,
163165 alertType : "on_change" ,
164166 frequency : 300 ,
@@ -178,6 +180,7 @@ new honeycomb.Trigger("IncreasedModelHttpErrorsGo", {
178180new honeycomb . Trigger ( "IncreasedModelHttpErrorsZen" , {
179181 name : "Increased Model HTTP Errors [Zen]" ,
180182 description,
183+ disabled : alertsDisabled ,
181184 queryJson : modelHttpErrorsQuery ( "zen" ) ,
182185 alertType : "on_change" ,
183186 frequency : 300 ,
@@ -197,6 +200,7 @@ new honeycomb.Trigger("IncreasedModelHttpErrorsZen", {
197200new honeycomb . Trigger ( "LowModelTpsGo" , {
198201 name : "Low Model TPS [Go]" ,
199202 description,
203+ disabled : alertsDisabled ,
200204 queryJson : modelLowTpsQuery ( "go" ) ,
201205 alertType : "on_change" ,
202206 frequency : 600 ,
@@ -216,6 +220,7 @@ new honeycomb.Trigger("LowModelTpsGo", {
216220new honeycomb . Trigger ( "LowModelTpsZen" , {
217221 name : "Low Model TPS [Zen]" ,
218222 description,
223+ disabled : alertsDisabled ,
219224 queryJson : modelLowTpsQuery ( "zen" ) ,
220225 alertType : "on_change" ,
221226 frequency : 600 ,
@@ -235,6 +240,7 @@ new honeycomb.Trigger("LowModelTpsZen", {
235240new honeycomb . Trigger ( "IncreasedProviderHttpErrors" , {
236241 name : "Increased Provider HTTP Errors" ,
237242 description,
243+ disabled : alertsDisabled ,
238244 queryJson : providerHttpErrorsQuery ( ) ,
239245 alertType : "on_change" ,
240246 frequency : 300 ,
@@ -254,6 +260,7 @@ new honeycomb.Trigger("IncreasedProviderHttpErrors", {
254260new honeycomb . Trigger ( "IncreasedFreeTierRequests" , {
255261 name : "Increased Free Tier Requests" ,
256262 description,
263+ disabled : alertsDisabled ,
257264 queryJson : honeycomb . getQuerySpecificationOutput ( {
258265 calculations : [ { op : "COUNT" } ] ,
259266 filters : [
0 commit comments