chore: add free tier usage alert

This commit is contained in:
vimtor
2026-05-07 13:32:32 +02:00
parent 95280ebec9
commit fbb7b5b1bf
2 changed files with 42 additions and 3 deletions

View File

@@ -169,3 +169,38 @@ new honeycomb.Trigger("IncreasedProviderHttpErrorsZen", {
},
],
})
new honeycomb.Trigger("IncreasedFreeTierRequests", {
disabled: true,
name: "Increased Free Tier Requests",
description,
queryJson: honeycomb.getQuerySpecificationOutput({
calculations: [
{
op: "COUNT",
name: "REQUESTS",
filterCombination: "AND",
filters: [
{ column: "event_type", op: "=", value: "completions" },
{ column: "user_agent", op: "contains", value: "opencode" },
{ column: "isFreeTier", op: "=", value: "true" },
],
},
],
timeRange: 14400,
}).json,
alertType: "on_change",
frequency: 3600,
thresholds: [{ op: ">=", value: 50, exceededLimit: 2 }],
baselineDetails: [{ type: "percentage", offsetMinutes: 1440 }],
recipients: [
{
id: webhookRecipient.id,
notificationDetails: [
{
variables: [{ name: "type", value: "custom" }],
},
],
},
],
})