updating helm/docker files and database config files
[it/otf.git] / otf-helm / otf / charts / databases / mongodb / templates / prometheus-alerting-rule.yaml
diff --git a/otf-helm/otf/charts/databases/mongodb/templates/prometheus-alerting-rule.yaml b/otf-helm/otf/charts/databases/mongodb/templates/prometheus-alerting-rule.yaml
new file mode 100644 (file)
index 0000000..84f5a53
--- /dev/null
@@ -0,0 +1,18 @@
+{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled .Values.metrics.serviceMonitor.alerting.rules }}
+apiVersion: monitoring.coreos.com/v1
+kind: PrometheusRule
+metadata:
+  name: {{ template "mongodb.fullname" . }}
+  namespace: {{.Values.namespace }}
+  labels:
+    app: {{ template "mongodb.name" . }}
+    chart: {{ template "mongodb.chart" . }}
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+    {{- if .Values.metrics.serviceMonitor.alerting.additionalLabels }}
+{{ toYaml .Values.metrics.serviceMonitor.alerting.additionalLabels | indent 4 }}
+    {{- end }}
+spec:
+  groups:
+{{ toYaml .Values.metrics.serviceMonitor.alerting.rules | indent 4 }}
+{{- end }}