Documentation
¶
Overview ¶
Package trigger ingests incidents (Alertmanager/VMAlert webhooks) and decides, per the configured policy, which ones start an investigation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchRequest ¶ added in v0.2.0
func MatchRequest(t config.IncidentTrigger, title, severity, environment, namespace string, labels map[string]string) bool
MatchRequest reports whether the trigger policy passes for a normalized investigation request. It reads the request fields produced by the source adapter / investigate.FromFailureEvent.
Note: the trigger package is imported by investigate (for Deduper), so trigger cannot import investigate without a cycle. Callers bridge the gap by extracting the relevant fields from investigate.Request:
trigger.MatchRequest(pol, r.Title, r.Severity, r.Environment, r.Workload.Namespace, r.Labels)
Types ¶
type Deduper ¶
type Deduper struct {
// contains filtered or unexported fields
}
Deduper suppresses repeated investigations of the same still-firing alert within a time window. Safe for concurrent use. The clock is injectable for tests.
func NewDeduper ¶
NewDeduper returns a Deduper with the given window. A zero window disables dedup.