Repository navigation
fix: show whether the scheduled alert evaluator is running - #683
Merged
Merged
Conversation
Scheduled rules never fire unless the separate evaluator cron runs. Each successful sweep now writes a heartbeat that /health reports without failing the API when the cron is missing. Co-authored-by: Sanja Malovic <[email protected]>
unjica
marked this pull request as ready for review
September 25, 2026 17:35
This was referenced Sep 25, 2026
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.
Base branch: open feature and fix PRs against
develop. Do not merge to production until the Railway cron below exists.Summary
TT-010 is a missing production service, not a bug in rule evaluation.
NO_EVENTSandHEARTBEATonly run insiderunScheduledAlertRuleEvaluation. Production Railway statuses on v1.17.20 (and earlier releases) listapi,dasboard,retention-cron, andalert-webhook-worker. There is noalert-rules-evaluatorservice, and the repo does not auto-provision one.This PR does not move evaluation into the API process. Each successful evaluator sweep writes a
ScheduledJobHeartbeatrow.GET /health(whenHEALTH_CHECK_DATABASE=true) addsalert_rules_evaluator:ok,stale, ornever. That field does not changeokor the HTTP status, so a missing cron cannot take the API down.ERROR_COUNT,NEW_ERROR_GROUP, andAFFECTED_USERSstay ingest-only.Railway step required before this helps production
Create a new service. Do not reuse
brief-worker, the API, or retention.apps/apinode dist/jobs/run-alert-rules-evaluator.js*/5 * * * *DATABASE_URLAfter the first successful run, logs should include
"job":"alert-rules-evaluator","ok":true, and/healthshould show"alert_rules_evaluator":"ok".How to test
pnpm lint && pnpm test && pnpm buildChecklist
[Unreleased]20260925170000_scheduled_job_heartbeat(API migrates before listen)Security / privacy
Heartbeat stores only a job name and timestamp. No alert payloads.