Repository navigation
feat(alerts): business heartbeats — NO_EVENTS eventName + rule editor - #837
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Business heartbeats MVP: alert when an expected custom event (e.g.
trackEvent("signup_verified")) has not arrived for X hours.API (
apps/api/src/lib/alert-rules.ts)NO_EVENTStakes an optionaleventName(trimmed, 1–200 chars, nullable). The normalizer only emits the key when set, so rules without it serialize and evaluate exactly as before.countEventsaddswhere.namewhen set (uses the existing[project_id, name, created_at]index).no "signup_verified" events in the last 6 hours in production) and links to/dashboard/events?name=…. Unnamed rules keep the overview link and text.Dashboard
NO_EVENTSrules with non-whole-hour windows stay list/toggle/remove-only (no silent rounding). ERROR_COUNT editing unchanged.Docs: "Business heartbeats" recipe in
docs/ALERT-RULES.mdand/docs/alerts; corrected "editor authors error-count only / API-only" copy (README, docs pages, llms.txt, two marketing pages); CHANGELOG.Tests: API — name filter, name + environment, unnamed rules unchanged, validation (empty/too long/non-string name, >24h). Dashboard — lib parse/serialize/defaults/round-trip and editor component.
No DB migration, no SDK change, no recovery notifications/templates/>24h windows.