github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-prometheus-stack/templates/prometheus/rules-1.14/general.rules.yaml (about) 1 {{- /* 2 Generated from 'general.rules' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubePrometheus-prometheusRule.yaml 3 Do not change in-place! In order to change this file first read following link: 4 https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack 5 */ -}} 6 {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} 7 {{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create .Values.defaultRules.rules.general }} 8 apiVersion: monitoring.coreos.com/v1 9 kind: PrometheusRule 10 metadata: 11 name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "general.rules" | trunc 63 | trimSuffix "-" }} 12 namespace: {{ template "kube-prometheus-stack.namespace" . }} 13 labels: 14 app: {{ template "kube-prometheus-stack.name" . }} 15 {{ include "kube-prometheus-stack.labels" . | indent 4 }} 16 {{- if .Values.defaultRules.labels }} 17 {{ toYaml .Values.defaultRules.labels | indent 4 }} 18 {{- end }} 19 {{- if .Values.defaultRules.annotations }} 20 annotations: 21 {{ toYaml .Values.defaultRules.annotations | indent 4 }} 22 {{- end }} 23 spec: 24 groups: 25 - name: general.rules 26 rules: 27 {{- if not (.Values.defaultRules.disabled.TargetDown | default false) }} 28 - alert: TargetDown 29 annotations: 30 {{- if .Values.defaultRules.additionalRuleAnnotations }} 31 {{ toYaml .Values.defaultRules.additionalRuleAnnotations | indent 8 }} 32 {{- end }} 33 description: '{{`{{`}} printf "%.4g" $value {{`}}`}}% of the {{`{{`}} $labels.job {{`}}`}}/{{`{{`}} $labels.service {{`}}`}} targets in {{`{{`}} $labels.namespace {{`}}`}} namespace are down.' 34 runbook_url: {{ .Values.defaultRules.runbookUrl }}/general/targetdown 35 summary: One or more targets are unreachable. 36 expr: 100 * (count(up == 0) by (job, namespace, service, verrazzano_cluster) / count(up) by (job, namespace, service, verrazzano_cluster)) > 10 37 for: 10m 38 labels: 39 severity: warning 40 {{- if .Values.defaultRules.additionalRuleLabels }} 41 {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} 42 {{- end }} 43 {{- end }} 44 {{- if not (.Values.defaultRules.disabled.Watchdog | default false) }} 45 - alert: Watchdog 46 annotations: 47 {{- if .Values.defaultRules.additionalRuleAnnotations }} 48 {{ toYaml .Values.defaultRules.additionalRuleAnnotations | indent 8 }} 49 {{- end }} 50 description: 'This is an alert meant to ensure that the entire alerting pipeline is functional. 51 52 This alert is always firing, therefore it should always be firing in Alertmanager 53 54 and always fire against a receiver. There are integrations with various notification 55 56 mechanisms that send a notification when this alert is not firing. For example the 57 58 "DeadMansSnitch" integration in PagerDuty. 59 60 ' 61 runbook_url: {{ .Values.defaultRules.runbookUrl }}/general/watchdog 62 summary: An alert that should always be firing to certify that Alertmanager is working properly. 63 expr: vector(1) 64 labels: 65 severity: none 66 {{- if .Values.defaultRules.additionalRuleLabels }} 67 {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} 68 {{- end }} 69 {{- end }} 70 {{- if not (.Values.defaultRules.disabled.InfoInhibitor | default false) }} 71 - alert: InfoInhibitor 72 annotations: 73 {{- if .Values.defaultRules.additionalRuleAnnotations }} 74 {{ toYaml .Values.defaultRules.additionalRuleAnnotations | indent 8 }} 75 {{- end }} 76 description: 'This is an alert that is used to inhibit info alerts. 77 78 By themselves, the info-level alerts are sometimes very noisy, but they are relevant when combined with 79 80 other alerts. 81 82 This alert fires whenever there''s a severity="info" alert, and stops firing when another alert with a 83 84 severity of ''warning'' or ''critical'' starts firing on the same namespace. 85 86 This alert should be routed to a null receiver and configured to inhibit alerts with severity="info". 87 88 ' 89 runbook_url: {{ .Values.defaultRules.runbookUrl }}/general/infoinhibitor 90 summary: Info-level alert inhibition. 91 expr: ALERTS{severity = "info"} == 1 unless on (namespace, verrazzano_cluster) ALERTS{alertname != "InfoInhibitor", severity =~ "warning|critical", alertstate="firing"} == 1 92 labels: 93 severity: none 94 {{- if .Values.defaultRules.additionalRuleLabels }} 95 {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} 96 {{- end }} 97 {{- end }} 98 {{- end }}