rancher-partner-charts/charts/digitalis/vals-operator/templates/prometheusrules.yaml

69 lines
2.8 KiB
YAML

{{- if .Values.prometheusRules.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "vals-operator.fullname" . }}
labels:
{{- include "vals-operator.labels" . | nindent 4 }}
spec:
groups:
- name: vals-operator
rules:
{{- if .Values.enableDbSecrets }}
- alert: ValsOperatorDbSecretError
expr: vals_operator_dbsecret_error > time() - 300
for: 30m
labels:
severity: warning
{{- if .Values.prometheusRules.additionalRuleLabels }}
{{- with .Values.prometheusRules.additionalRuleLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
annotations:
summary: vals-operator database secret not issued
description: "Vals operator has been unable to issue database credentials for secret {{`{{`}}$labels.secret{{`}}`}} in namespace {{`{{`}}$labels.namespace{{`}}`}}"
{{- if .Values.prometheusRules.additionalRuleAnnotations }}
{{- with .Values.prometheusRules.additionalRuleAnnotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
- alert: ValsOperatorDbSecretExpired
expr: time() > vals_operator_dbsecret_expire_time
for: 30m
labels:
severity: warning
{{- if .Values.prometheusRules.additionalRuleLabels }}
{{- with .Values.prometheusRules.additionalRuleLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
annotations:
summary: vals-operator database secret expired
description: "Vals operator database credentials for secret {{`{{`}}$labels.secret{{`}}`}} in namespace {{`{{`}}$labels.namespace{{`}}`}} expired"
{{- if .Values.prometheusRules.additionalRuleAnnotations }}
{{- with .Values.prometheusRules.additionalRuleAnnotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
- alert: ValsOperatorSecretError
expr: vals_operator_secret_error > time() - 300
for: 30m
labels:
severity: warning
{{- if .Values.prometheusRules.additionalRuleLabels }}
{{- with .Values.prometheusRules.additionalRuleLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
annotations:
summary: vals-operator secret not issued
description: "Vals operator has been unable to create the secret for {{`{{`}}$labels.secret{{`}}`}} in namespace {{`{{`}}$labels.namespace{{`}}`}}"
{{- if .Values.prometheusRules.additionalRuleAnnotations }}
{{- with .Values.prometheusRules.additionalRuleAnnotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}