-
Notifications
You must be signed in to change notification settings - Fork 445
/
prometheusrule.yaml
42 lines (42 loc) · 1.69 KB
/
prometheusrule.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{{- if and .Values.manager.prometheusRule.enabled .Values.manager.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
{{- range $key, $value := .Values.manager.prometheusRule.extraLabels }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
annotations:
{{- range $key, $value := .Values.manager.serviceMonitor.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
spec:
groups:
{{- if .Values.manager.prometheusRule.groups }}
{{- toYaml .Values.manager.prometheusRule.groups | nindent 4 }}
{{- end }}
{{- if .Values.manager.prometheusRule.defaultRules.enabled }}
- name: managerRules
rules:
- alert: ReconcileErrors
expr: rate(controller_runtime_reconcile_total{controller="opentelemetrycollector",result="error"}[5m]) > 0
for: 5m
labels:
severity: warning
annotations:
description: '{{`Reconciliation errors for {{ $labels.controller }} is increasing and has now reached {{ humanize $value }} `}}'
runbook_url: 'Check manager logs for reasons why this might happen'
- alert: WorkqueueDepth
expr: workqueue_depth{name="opentelemetrycollector"} > 0
for: 5m
labels:
severity: warning
annotations:
description: '{{`Queue depth for {{ $labels.name }} has reached {{ $value }} `}}'
runbook_url: 'Check manager logs for reasons why this might happen'
{{- end }}
{{- end }}