feat(alerts): persist alert events from stored metric and release observations - #57
Merged
Conversation
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.
Summary
Add a first persisted alert-evaluation runtime that reads stored observations from SQLite and materializes derived
alert_eventsfor supported rule families.Linked issue(s)
Milestone fit
This PR advances
v0.4.0by turning persisted metric snapshots and stored release observations into auditable alert rows without relying on transient fetch responses.It intentionally keeps alert delivery, dashboard views, candidate-suggestion processing, and documentation reconciliation out of scope for this issue.
What changed
internal/alertsruntime that evaluates enabled alert rules from persisted SQLite observationsabsolute_change_gtepercent_change_gteevent_key = "release.published"condition.type = "silence_then_event"alert_eventswith copied rule context, severity, timestamps, summaries, and auditable JSON payloadsOut of scope
news.co_mention/candidate_repeat_gteprocessing andcandidate_suggestionsValidation
Mark what you actually ran:
python3 ./scripts/trim-whitespace.py --checkgo vet ./...go test ./...make ciDocumentation impact
README.mdSPEC.mddocs/AGENTS.md,CONTRIBUTING.md)CHANGELOG.mdDocumentation reconciliation for alert/runtime notes is intentionally deferred to the dedicated end-of-milestone docs issue.
Reviewer focus
Call out the highest-risk files, behaviors, or assumptions to review.
internal/alerts/runtime.gointernal/alerts/runtime_test.gorepository) when availableAuditability checklist
Notes for merge
Preferred merge method: