feat(billing): add billing alerting#65884
Conversation
|
Size Change: +14.4 kB (+0.02%) Total Size: 64.1 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Reviews (1): Last reviewed commit: "feat(billing): add billing alerting" | Re-trigger Greptile |
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
5c740b8 to
868d342
Compare
|
Reviews (2): Last reviewed commit: "fix(billing): harden alert evaluation an..." | Re-trigger Greptile |
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
MCP UI Apps size report
|
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
🔍 Migration Risk AnalysisWe've analyzed your migrations for potential risks. Summary: 1 Safe | 0 Needs Review | 0 Blocked ✅ SafeBrief or no lock, backwards compatible Last updated: 2026-06-26 00:18 UTC (175f66f) |
Why?
Lots of customers have asked for this, especially spend spike notifications when daily burn jumps unexpectedly, project-level billing alert controls, and billing notifications that don't depend on an org owner receiving the email.
I didn't want to create more work for others, so I checked the existing patterns and architecture first.
How?
What?
Local proof screenshots
Billing alert created through the UI and firing after the synthetic billing spike:
Slack notification delivered to
#will-account-alerts:How did you test this code?
bin/hogli build:openapiuv run ruff check products/billing_alerts posthog/temporal/billing_alerts posthog/management/commands/start_temporal_worker.py posthog/settings/web.py posthog/temporal/schedule.pypnpm exec oxfmt --check frontend/src/lib/components/Alerting frontend/src/scenes/billing/BillingAlerts.tsx frontend/src/scenes/billing/billingAlertsLogic.ts frontend/src/scenes/billing/BillingSection.tsx frontend/src/scenes/billing/types.ts frontend/src/scenes/hog-functions/AlertWizard/AlertWizard.tsx frontend/src/scenes/hog-functions/AlertWizard/steps/WizardCard.tsx frontend/src/scenes/hog-functions/list/HogFunctionsList.tsxpnpm exec oxlint frontend/src/lib/components/Alerting frontend/src/scenes/billing/BillingAlerts.tsx frontend/src/scenes/billing/billingAlertsLogic.ts frontend/src/scenes/billing/BillingSection.tsx frontend/src/scenes/billing/types.ts frontend/src/scenes/hog-functions/AlertWizard/AlertWizard.tsx frontend/src/scenes/hog-functions/AlertWizard/steps/WizardCard.tsx frontend/src/scenes/hog-functions/list/HogFunctionsList.tsxManual UI plus Slack proof run:
Prereqs:
SLACK_APP_CLIENT_ID,SLACK_APP_CLIENT_SECRET, andSLACK_APP_SIGNING_SECRET.Ask your agent to:
Billing > Alerts > New notification, choose Slack, and select a Slack channel.10for 7 days and current spend was100.notification_sent_at, the HogFunction invocation inposthog.hog_invocation_resultsissucceeded, and the Slack message is visible in the selected channel.Proof records from the local run:
Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
We should once done?
Agent context
Autonomy: Human-driven, agent-assisted.
Implementation was guided by local repo inspection, existing alerting UI patterns, and local validation.
The main design choice was to keep shared alerting components atomic and pass billing-specific trigger/configuration UI into those primitives, rather than baking billing behavior into the shared layer.