Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTemplateFunc ¶ added in v1.34.6
InitTemplateFunc returns template helper functions
func ValidateAnnotations ¶
ValidateAnnotations validate annotations for possible template error, uses empty data for template population
Types ¶
type Alert ¶
type Alert struct { Group string Name string Labels []datasource.Label Annotations map[string]string Start time.Time End time.Time Value float64 }
Alert the triggered alert
func AlertsFromMetrics ¶
func AlertsFromMetrics(metrics []datasource.Metric, group string, rule Rule, start, end time.Time) []Alert
AlertsFromMetrics converts metrics to alerts by alert Rule
type Rule ¶
type Rule struct { Name string `yaml:"alert"` Expr string `yaml:"expr"` For time.Duration `yaml:"for"` Labels map[string]string `yaml:"labels"` Annotations map[string]string `yaml:"annotations"` }
Rule is basic alert entity
type Time ¶ added in v1.34.6
type Time int64
Time is the number of milliseconds since the epoch (1970-01-01 00:00 UTC) excluding leap seconds.
func TimeFromUnixNano ¶ added in v1.34.6
TimeFromUnixNano returns the Time equivalent to the Unix Time t provided in nanoseconds.
Click to show internal directories.
Click to hide internal directories.