Add alert resource contract (metric alerts phase 1) - #133
Open
acoshift wants to merge 1 commit into
Open
Conversation
Metric alert rules on platform metrics: when a deployment metric (cpu, memory, requests, egress) crosses a threshold for N minutes, the platform notifies through existing notification channels via alert.trigger / alert.resolve events. This adds the contract only; evaluation lives in apiserver (alert-tick cron).
This was referenced Aug 11, 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.
Summary
Contract for the new project-scoped
alertresource — metric alert rules on platform metrics (SPEC-metric-alerts.md, Phase 1). A rule watches one metric of one deployment (cpu/memoryas % of limit,requests/egressper-minute) withop + threshold + forMinutes, evaluated server-side by an apiserver cron (separate PR). Delivery reuses notification channels entirely.Alertinterface: create/update/get/list/delete/events (+ client, wired intoInterface)AlertTarget,AlertCondition,AlertItem(incl. read-only evaluator stateok|firing|nodata), events history>=, percent-threshold cap, forMinutes 1–60, renotify 0 or 10–1440alert.*+ 5 actions;.get/.listpublic-bindable via existing classifiers (test-asserted)alert.create/update/delete(audited config changes) +alert.trigger/resolve(evaluator transitions, notify-only)ErrAlertNotFound,ErrAlertAlreadyExists,ErrMaximumAlertRulesReachedTesting
go build ./... && go vet ./... && go test ./...green; table-drivenValid()tests, catalog membership, permission classification.