Documentation
¶
Index ¶
Constants ¶
View Source
const ( EventStatusCritical = "Critical" EventStatusWarning = "Warning" EventStatusInfo = "Info" EventStatusOk = "Ok" DescFormatText = "" DescFormatMarkdown = "markdown" // AttrCurrentValue is the standard Attrs key for the primary metric value // that triggered an alert. Plugins should set this so that diagnosis records // and AI prompts can display it consistently. AttrCurrentValue = "current_value" // AttrThresholdDesc is a human-readable description of the threshold(s) // that define when this check fires. Plugins format it freely, e.g. // "Warning ≥ 80.0%, Critical ≥ 95.0%" or "Critical: state ≠ active". AttrThresholdDesc = "threshold_desc" )
Variables ¶
This section is empty.
Functions ¶
func EvaluateGeThreshold ¶
EvaluateGeThreshold returns the event status for a "greater-than-or-equal" threshold pair. A threshold value of 0 means "not configured / disabled".
func EventStatusValid ¶
Types ¶
type Event ¶
type Event struct {
EventTime int64 `json:"event_time"`
EventStatus string `json:"event_status"`
AlertKey string `json:"alert_key"`
Labels map[string]string `json:"labels"`
Attrs map[string]string `json:"attrs,omitempty"`
Description string `json:"description"`
DescriptionFormat string `json:"description_format,omitempty"`
// for internal use
FirstFireTime int64 `json:"-"`
NotifyCount int64 `json:"-"`
LastSent int64 `json:"-"`
}
func BuildEvent ¶
func (*Event) SetCurrentValue ¶
func (*Event) SetDescription ¶
func (*Event) SetEventStatus ¶
func (*Event) SetEventTime ¶
Click to show internal directories.
Click to hide internal directories.