origin
origin copied to clipboard
Customize Prometheus Alerts in OKD 4.11
We are using prometheus included in okd to gather metrics of our cluster:
- OKD version release: 4.11.0-0.okd-2022-08-20-022919
- UPI install on baremetal
Actually we created a new metric along their alert rule for storage use with this yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: storagealertprodcritical
managedFields:
labels:
role: storagealertprodcritical
spec:
groups:
- name: default-storage-classes.rules
rules:
- alert: CustomPersistentVolumeFillingUpCritical
annotations:
description: >
"Storage Alert. [Critical]"
message: >-
"Space used more than %90"
summary: Make free space
expr: '(kubelet_volume_stats_available_bytes{job="kubelet",metrics_path="/metrics",namespace=~"(.*-pro)"} / kubelet_volume_stats_capacity_bytes{job="kubelet",metrics_path="/metrics",namespace=~"(.*-pro)"}) < 0.10'
for: 10m
labels:
severity: critical
This alerts are sent by email and works just fine.
From the above we want 2 things:
- Be able to customize the subject and the body of the alert sent to the email.
- Be capable to send them by Telegram.