This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alerterator.yml
34 lines (31 loc) · 1.78 KB
/
alerterator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
apiVersion: nais.io/v1
kind: Alert
metadata:
name: {{app}}-alerts
labels:
team: {{team}}
namespace: {{namespace}}
spec:
receivers:
slack:
channel: {{slack-channel}}
prependText: "{{{slack-notify-type}}}"
alerts:
- alert: {{app}} nede
expr: kube_deployment_status_replicas_available{deployment="{{app}}"} == 0
for: 10m
description: "App \{{ $labels.app }} er nede i namespace \{{ $labels.kubernetes_namespace }}"
action: "`kubectl describe pod \{{ $labels.kubernetes_pod_name }} -n \{{ $labels.kubernetes_namespace }}` for events, og `kubectl logs \{{ $labels.kubernetes_pod_name }} -n \{{ $labels.kubernetes_namespace }}` for logger"
- alert: høy andel error i logger i {{app}}
expr: (100 * sum by (log_app, log_namespace) (rate(logd_messages_total{log_app="{{app}}",log_level=~"Error"}[3m])) / sum by (log_app, log_namespace) (rate(logd_messages_total{log_app="{{app}}"}[3m]))) > 0
for: 3m
action: "Sjekk loggene til app \{{ $labels.log_app }} i namespace \{{ $labels.log_namespace }}, for å se hvorfor det er så mye feil"
- alert: høy andel warning i logger i {{app}}
expr: (100 * sum by (log_app, log_namespace) (rate(logd_messages_total{log_app="{{app}}",log_level=~"Warning"}[3m])) / sum by (log_app, log_namespace) (rate(logd_messages_total{log_app="{{app}}"}[3m]))) > 10
for: 3m
action: "Sjekk loggene til app \{{ $labels.log_app }} i namespace \{{ $labels.log_namespace }}, for å se hvorfor det er så mye warnings"
- alert: {{app}} feiler
expr: stream_status{app="{{app}}"} > 0
for: 20m
description: "\{{ $labels.stream }}-stream feiler. Sjekk loggene for å se hvorfor."
action: "`kubectl logs \{{ $labels.kubernetes_pod_name }} -n \{{ $labels.kubernetes_namespace }}`"