8 Configuring Alerts
To configure Alerts:
Note:
In the below procedure, _NAME_ is the Helm Chart Release Name and _Namespace_ is the Prometheus NameSpace.- Execute the following command to take backup of current config map of
Prometheus.
kubectl get configmaps occne-prometheus-server -o yaml -n occne-infra > /tmp/tempConfig.yaml
- Execute the following commands to add UDR alerts file to the Prometheus
configmap yaml file.
sed -i '/etc\/config\/alertsudr/d' /tmp/tempConfig.yaml
sed -i '/rule_files:/a\ \- /etc/config/alertsudr' /tmp/tempConfig.yaml
- Execute the following command to update the Prometheus configmap yaml file with
updated UDR alert file name.
kubectl replace configmap occne-prometheus-server -f /tmp/tempConfig.yaml
- Execute the following command to add the UDR alerts rules in configmap under UDR
alert file name.
kubectl patch configmap occne-prometheus-server -n occne-infra --type merge --patch "$(cat ~/UdrAlertrules.yaml)"
Note:
Prometheus server takes updated configmap reloaded after sometime automatically (approximately 20 sec).