Prometheus发送告警机制
type Alert struct {
State AlertState # Inactive Pending Firing
Labels labels.Labels
Annotations labels.Labels
Value float64 # The value at the last evaluation of the alerting expression
ActiveAt time.Time
FiredAt time.Time
ResolvedAt time.Time # ResolvedAt will be 0 to indicate a still active alert
LastSentAt time.Time
ValidUntil time.Time
}groups:
- name: Node
rules:
- alert: NodeCpuPressure
expr: 100 * (1 - avg(irate(node_cpu_seconds_total{mode="idle"}[2m])) by(instance)) > 80
for: 2m
annotations:
summary: "NodeCpuPressure, Node: {{$labels.node}}, Value: {{$value}}, Threshold: 80%"Last updated