feat(alerts): record why a check was skipped - #1206
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (35)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Maple review🟡 Confidence 3/5 · needs attention Warning This review ended early; what follows is what it established. A skipped alert check now records why it skipped (
What was checked
Files not reviewed (2)The review ended before it read these diffs, so nothing above vouches for them.
|
A skipped check read the same whether the query returned no rows, fell below the minimum sample count, or produced no scalar, and next to healthy checks it was easy to read a blind rule as a quiet one. alerting-core now sets a skipReason (no_data, below_min_samples, no_value) on every skip, replacing the skippedForNoData flag. The scheduler writes it to a new alert_checks.SkipReason column (ClickHouse migration 0036, local schema v27), and it is exposed as skipReason on check documents, skip_reason on the v2 API, and in list_alert_checks, whose summary and value column now say "no data" or "below min samples". The rule diagnosis and chart rail tell the two apart too.
…none Place alert_checks.SkipReason after the existing columns, where migration 0036's ADD COLUMN puts it, so the Tinybird datasource and every ClickHouse copy agree on column order (local schema v27 regenerated). A skip reason this build does not recognise now reads as null instead of failing the whole checks page.
e7894d9 to
6a90ec1
Compare
|
Note A newer push replaced |
|
Note A newer push replaced |
400d5a9 to
6a90ec1
Compare
Stack 2/5. A skipped check looked the same whether the query returned no rows, fell below the minimum sample count, or produced no scalar, and it sat next to healthy checks.
alerting-coresetsskipReason(no_data,below_min_samples,no_value) on every skip, replacing theskippedForNoDataflag.alert_checks.SkipReasoncolumn: ClickHouse migration 0036, local schema v27, Tinybird manifest regenerated.skipReasonon check documents,skip_reasonon the v2 checks API, and inlist_alert_checks, whose summary reads5 skipped [4 no data, 1 below min samples]and whose value column says why.Rows recorded before the deploy have no reason (
null).Test: alerting-core,
AlertsService.test.ts(new skip-reason case),AlertReadModelsService.test.ts, migrations index, local-store migrations (bun), alert-tools, v2 alerts.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit