-
Notifications
You must be signed in to change notification settings - Fork 19
/
alert.yaml
25 lines (25 loc) · 1.09 KB
/
alert.yaml
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
{{- if and .Values.keycloak.metrics.enabled .Values.keycloak.alerting.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "keycloak.fullname" . }}-prom-rule
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: keycloak
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
groups:
- name: keycloak.alerts
rules:
{{- if .Values.keycloak.alerting.requestError.enabled }}
- alert: KeycloakRequestErrors
expr: |
delta(keycloak_response_errors{namespace="{{ .Release.Namespace }}"}[{{ .Values.keycloak.alerting.requestError.timeWindow }}]) > {{ .Values.keycloak.alerting.requestError.threshold }}
labels:
severity: {{ .Values.keycloak.alerting.requestError.severity }}
{{- end -}}
{{- end -}}