github.com/verrazzano/verrazzano@v1.7.1/platform-operator/thirdparty/charts/thanos/templates/alert-rule/absent_rules.yml (about) 1 {{- /* 2 Generated from https://github.com/thanos-io/thanos/blob/main/examples/alerts/alerts.md 3 */ -}} 4 {{- if and .Values.metrics.enabled (or .Values.metrics.prometheusRule.default.create .Values.metrics.prometheusRule.default.absent_rules ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }} 5 apiVersion: monitoring.coreos.com/v1 6 kind: PrometheusRule 7 metadata: 8 name: {{ template "common.names.fullname" . }}-component-absent 9 namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }} 10 labels: {{- include "common.labels.standard" . | nindent 4 }} 11 {{- if .Values.metrics.prometheusRule.additionalLabels }} 12 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 4 }} 13 {{- end }} 14 {{- if .Values.commonLabels }} 15 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 16 {{- end }} 17 {{- if .Values.commonAnnotations }} 18 annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 19 {{- end }} 20 spec: 21 groups: 22 - name: thanos-component-absent 23 rules: 24 {{- if and (not (.Values.metrics.prometheusRule.default.disabled.ThanosCompactIsDown | default false)) .Values.compactor.enabled }} 25 - alert: ThanosCompactIsDown 26 annotations: 27 {{- if .Values.commonAnnotations }} 28 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 29 {{- end }} 30 description: ThanosCompact has disappeared. Prometheus target for the component cannot be discovered. 31 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanoscompactisdown 32 summary: Thanos component has disappeared. 33 expr: | 34 absent(up{job=~".*thanos-compact.*"} == 1) 35 for: 5m 36 labels: 37 severity: critical 38 {{- if .Values.metrics.prometheusRule.additionalLabels }} 39 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 40 {{- end }} 41 {{- end }} 42 {{- if and (not (.Values.metrics.prometheusRule.default.disabled.ThanosQueryIsDown | default false)) .Values.query.enabled }} 43 - alert: ThanosQueryIsDown 44 annotations: 45 {{- if .Values.commonAnnotations }} 46 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 47 {{- end }} 48 description: ThanosQuery has disappeared. Prometheus target for the component cannot be discovered. 49 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanosqueryisdown 50 summary: Thanos component has disappeared. 51 expr: | 52 absent(up{job=~".*thanos-query.*"} == 1) 53 for: 5m 54 labels: 55 severity: critical 56 {{- if .Values.metrics.prometheusRule.additionalLabels }} 57 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 58 {{- end }} 59 {{- end }} 60 {{- if and (not (.Values.metrics.prometheusRule.default.disabled.ThanosReceiveIsDown | default false)) .Values.receive.enabled }} 61 - alert: ThanosReceiveIsDown 62 annotations: 63 {{- if .Values.commonAnnotations }} 64 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 65 {{- end }} 66 description: ThanosReceive has disappeared. Prometheus target for the component cannot be discovered. 67 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanosreceiveisdown 68 summary: Thanos component has disappeared. 69 expr: | 70 absent(up{job=~".*thanos-receive.*"} == 1) 71 for: 5m 72 labels: 73 severity: critical 74 {{- if .Values.metrics.prometheusRule.additionalLabels }} 75 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 76 {{- end }} 77 {{- end }} 78 {{- if and (not (.Values.metrics.prometheusRule.default.disabled.ThanosRuleIsDown | default false)) .Values.ruler.enabled }} 79 - alert: ThanosRuleIsDown 80 annotations: 81 {{- if .Values.commonAnnotations }} 82 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 83 {{- end }} 84 description: ThanosRule has disappeared. Prometheus target for the component cannot be discovered. 85 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanosruleisdown 86 summary: Thanos component has disappeared. 87 expr: | 88 absent(up{job=~".*thanos-rule.*"} == 1) 89 for: 5m 90 labels: 91 severity: critical 92 {{- if .Values.metrics.prometheusRule.additionalLabels }} 93 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 94 {{- end }} 95 {{- end }} 96 {{- if not (.Values.metrics.prometheusRule.default.disabled.ThanosSidecarIsDown | default false) }} 97 - alert: ThanosSidecarIsDown 98 annotations: 99 {{- if .Values.commonAnnotations }} 100 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 101 {{- end }} 102 description: ThanosSidecar has disappeared. Prometheus target for the component cannot be discovered. 103 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanossidecarisdown 104 summary: Thanos component has disappeared. 105 expr: | 106 absent(up{job=~".*thanos-discovery.*"} == 1) 107 for: 5m 108 labels: 109 severity: critical 110 {{- if .Values.metrics.prometheusRule.additionalLabels }} 111 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 112 {{- end }} 113 {{- end }} 114 {{- if and (not (.Values.metrics.prometheusRule.default.disabled.ThanosStoreIsDown | default false)) .Values.storegateway.enabled }} 115 - alert: ThanosStoreIsDown 116 annotations: 117 {{- if .Values.commonAnnotations }} 118 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} 119 {{- end }} 120 description: ThanosStore has disappeared. Prometheus target for the component cannot be discovered. 121 runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanosstoreisdown 122 summary: Thanos component has disappeared. 123 expr: | 124 absent(up{job=~".*thanos-store.*"} == 1) 125 for: 5m 126 labels: 127 severity: critical 128 {{- if .Values.metrics.prometheusRule.additionalLabels }} 129 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 8 }} 130 {{- end }} 131 {{- end }} 132 {{- end }}