Monitoring — observation. Alerting — notification.
1# Prometheus Alert Rules2groups:3 - name: app4 rules:5 - alert: HighErrorRate6 expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.17 for: 5m8 labels:9 severity: critical10 annotations:11 summary: "High error rate detected"12 description: "Error rate is {{ $value }}"1314 - alert: HighLatency15 expr: histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m])) > 116 for: 5m17 labels:18 severity: warning19 annotations:20 summary: "High latency detected"2122 - alert: PodRestartLoop23 expr: increase(kube_pod_container_status_restarts_total[1h]) > 524 labels:25 severity: critical
1# AlertManager Config2global:3 resolve_timeout: 5m45route:6 receiver: slack7 group_by: [alertname, severity]8 group_wait: 30s9 repeat_interval: 1h1011receivers:12 - name: slack13 slack_configs:14 - api_url: "https://hooks.slack.com/services/..."15 channel: "#alerts"16 title: "{{ .GroupLabels.alertname }}"17 text: "{{ range .Alerts }}{{ .Annotations.summary }}{{ end }}"1819 - name: pagerduty20 pagerduty_configs:21 - service_key: "..."
Metrics (RED/USE):