fix(infra-monitoring): enable servicemonitor for karma
This commit is contained in:
parent
75c774d559
commit
fbdda11e5a
2 changed files with 36 additions and 0 deletions
32
infra-monitoring/templates/karma/prometheus-rules.yaml
Normal file
32
infra-monitoring/templates/karma/prometheus-rules.yaml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{{- if and .Values.karma.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }}
|
||||||
|
---
|
||||||
|
apiVersion: "monitoring.coreos.com/v1"
|
||||||
|
kind: "PrometheusRule"
|
||||||
|
metadata:
|
||||||
|
name: karma
|
||||||
|
labels:
|
||||||
|
{{- toYaml .Values.commons.prometheus.rules.labels | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: "Karma"
|
||||||
|
rules:
|
||||||
|
- alert: "Karma scrape alertmanager"
|
||||||
|
expr: 'sum(karma_alertmanager_up) == 0'
|
||||||
|
for: "5m"
|
||||||
|
labels:
|
||||||
|
severity: "critical"
|
||||||
|
annotations:
|
||||||
|
{{`
|
||||||
|
summary: "No Alertmanager is reachable for more than 5 minutes."
|
||||||
|
`}}
|
||||||
|
|
||||||
|
- alert: "Karma scrape alertmanager"
|
||||||
|
expr: 'max(karma_alertmanager_up) by (alertmanager) == 0'
|
||||||
|
for: "5m"
|
||||||
|
labels:
|
||||||
|
severity: "warning"
|
||||||
|
annotations:
|
||||||
|
{{`
|
||||||
|
summary: "Alertmanager {{ $labels.alertmanager }} is not reachable for more than 5 minutes."
|
||||||
|
`}}
|
||||||
|
{{- end }}
|
|
@ -140,4 +140,8 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}{{/* end-with karma.ingress */}}
|
{{- end }}{{/* end-with karma.ingress */}}
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: {{ (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
|
||||||
|
additionalLabels:
|
||||||
|
{{- toYaml .Values.commons.prometheus.monitor.labels | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue