Analysis & planning
Alert channels
Send budget and spend alerts to Slack, Microsoft Teams, PagerDuty, Opsgenie or a signed webhook, plus spike checks on every hour (alerts go out at the next scheduled run, daily on the hosted plan today) and gateway budget status.
Alerts go to owners and admins by email and, when you add channels, to Slack, Microsoft Teams, PagerDuty, Opsgenie or a signed webhook. Each budget and each workspace rule picks its own channels.
How to use it
- On Budgets, Where alerts go, an admin adds a channel: a Slack incoming webhook URL, a Teams Workflows or incoming webhook URL, a PagerDuty Events API v2 key (US or EU), an Opsgenie API key (US or EU) or an https webhook URL.
- Send test posts a test alert and records whether it was delivered.
- In a budget form, Also send to picks channels. Workspace rules (hourly spike, unusual spend, spend growth, sync failure, missing billing data) pick theirs on the same card.
- Each alert in the list shows where it went, for example #ai-spend sent, On call failed.
Signed webhooks
A POST with a JSON body (id, type, severity, title, message, data, created_at, link, test) and the headers X-Spendbook-Timestamp, X-Spendbook-Signature: v1=<hex>, X-Spendbook-Delivery and X-Spendbook-Event. The signature is HMAC-SHA256 with the whsec_ secret over the timestamp, a dot and the raw body. The secret is shown once.
# Verify a signed alert webhook (Python)
import hashlib, hmac, time
def verify(secret: str, timestamp: str, raw_body: bytes, signature_header: str) -> bool:
if abs(time.time() - int(timestamp)) > 300: # reject anything older than 5 minutes
return False
expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature_header.removeprefix("v1="))Hourly spikes, account owners and gateways
- Hourly spike: every complete UTC hour since the previous check, each hour's telemetry cost against the average of the hours that had spend in the previous 23, for the workspace and each customer and feature. It alerts above 3 times the average and at least $5, one alert per hour and scope.
- A new workspace, customer or feature needs 6 hours with spend before it can alert. A level that stays high after a spike is reported once, in the hour it started, not every hour while the average catches up.
- A customer's account owner (set on the customer detail panel, with an optional channel and Slack member to mention) also gets alerts about that customer. With no owner saved, the account owner from a connected Salesforce or HubSpot account gets them.
- A gateway can read budget state with a read key:
GET /api/v1/budgets/gateway-statusreturns ok, warn or over per budget, with ETag and a 30 second cache. Blocking requests is up to the gateway.
Limits
- URLs and keys are stored encrypted and never shown again. Webhook URLs must be https and public. At most 50 channels per workspace and 10 per rule.
- Slack posts to the channel chosen when its webhook was created. PagerDuty and Opsgenie use the alert id, so a repeat updates the same incident.
- Spike checks use telemetry only. Every hour is checked, and alerts go out at the next scheduled run: daily on the hosted plan today, so a spike can arrive up to a day later.
- Sample workspaces never post to channels.