Test alert
This commit is contained in:
parent
9a6b86f96e
commit
9a0303cbb5
|
|
@ -6,10 +6,29 @@ metadata:
|
||||||
app: kube-prometheus-stack
|
app: kube-prometheus-stack
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
groups:
|
groups:
|
||||||
- name: node.alerts
|
- name: node.alerts
|
||||||
rules:
|
rules:
|
||||||
- alert: NodeHighCPU
|
- alert: InternalTestAlert
|
||||||
|
expr: vector(1)
|
||||||
|
for: 0m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "Internal Alert Pipeline Test"
|
||||||
|
description: "This alert is manually triggered to verify the Slack alerting pipeline."
|
||||||
|
|
||||||
|
- alert: NodeMissingWorkloadLabel
|
||||||
|
expr: |
|
||||||
|
count by (instance) (node_cpu_seconds_total) unless count by (instance) (node_cpu_seconds_total{workload=~".+"})
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: warning
|
||||||
|
annotations:
|
||||||
|
summary: "Node missing workload label on metrics"
|
||||||
|
description: "Metrics for instance {{ "{{" }} $labels.instance {{ "}}" }} are missing the 'workload' label, which is required for NodeHighCPU alerts."
|
||||||
|
|
||||||
|
- alert: MediaNodeHighCPU
|
||||||
expr: |
|
expr: |
|
||||||
(
|
(
|
||||||
(1 - avg without (cpu, mode) (rate(node_cpu_seconds_total{mode="idle", workload="media"}[1m]))) * 100 > {{ .Values.cpuThresholdMedia | default 65 }}
|
(1 - avg without (cpu, mode) (rate(node_cpu_seconds_total{mode="idle", workload="media"}[1m]))) * 100 > {{ .Values.cpuThresholdMedia | default 65 }}
|
||||||
|
|
@ -23,4 +42,4 @@ spec:
|
||||||
severity: warning
|
severity: warning
|
||||||
annotations:
|
annotations:
|
||||||
summary: "High CPU usage on node {{ "{{" }} $labels.instance {{ "}}" }}"
|
summary: "High CPU usage on node {{ "{{" }} $labels.instance {{ "}}" }}"
|
||||||
description: "Node {{ "{{" }} $labels.instance {{ "}}" }} has CPU usage above threshold (current value: {{ "{{" }} $value | printf \"%.2f\" {{ "}}" }}%)"
|
description: "Node {{ "{{" }} $labels.instance {{ "}}" }} (workload: {{ "{{" }} $labels.workload {{ "}}" }}) has CPU usage above threshold (current value: {{ "{{" }} $value | printf \"%.2f\" {{ "}}" }}%)"
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,15 @@ kube-prometheus-stack:
|
||||||
repeat_interval: 12h
|
repeat_interval: 12h
|
||||||
receiver: 'null'
|
receiver: 'null'
|
||||||
routes:
|
routes:
|
||||||
|
- match:
|
||||||
|
alertname: InternalTestAlert
|
||||||
|
receiver: 'slack-notifications'
|
||||||
|
- match:
|
||||||
|
alertname: MediaNodeHighCPU
|
||||||
|
receiver: 'slack-notifications'
|
||||||
|
- match:
|
||||||
|
alertname: NodeMissingWorkloadLabel
|
||||||
|
receiver: 'slack-notifications'
|
||||||
- match:
|
- match:
|
||||||
alertname: NodeHighCPU
|
alertname: NodeHighCPU
|
||||||
receiver: 'slack-notifications'
|
receiver: 'slack-notifications'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue