helm collabora kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

163 lines
6.0 KiB

{{- if and ( .Values.prometheus.rules.enabled ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "collabora-online.fullname" . }}
{{- with .Values.prometheus.rules.namespace }}
namespace: {{ . | quote }}
{{- end }}
labels:
{{- include "collabora-online.labels" . | nindent 4 }}
{{- toYaml .Values.prometheus.rules.additionalLabels | nindent 4 }}
spec:
groups:
{{- if .Values.prometheus.rules.defaults.enabled }}
- name: {{ template "collabora-online.name" . }}-Defaults
rules:
- alert: "Collabora NoProcess"
expr: 'coolwsd_count < 1'
for: "1m"
labels:
severity: "critical"
{{`
annotations:
summary: "no coolwsd process running: in namespace {{ $labels.namespace }}"
`}}
{{- range $key, $value := .Values.prometheus.rules.defaults.docs.pod }}
- alert: "Collabora Open Docs by Pod"
expr: 'kit_assigned_count > {{ $value }}'
for: "1m"
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "Too many Docs are open on a pod in namespace: {{ $labels.namespace }}"
`}}
{{- end }}
{{- range $key, $value := .Values.prometheus.rules.defaults.docs.sum }}
- alert: "Collabora Open Docs by Namespace"
expr: 'sum(kit_assigned_count) without (instance, pod) > {{ $value }}'
for: "1m"
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "Too many Docs are open on namespace"
`}}
{{- end }}
{{- range $key, $value := .Values.prometheus.rules.defaults.viewers.pod }}
- alert: "Collabora Viewers by Pod"
expr: 'document_active_views_active_count_total > {{ $value }}'
for: "1m"
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "Too many Viewers on a pod in namespace: {{ $labels.namespace }}"
`}}
{{- end }}
{{- range $key, $value := .Values.prometheus.rules.defaults.viewers.doc }}
- alert: "Collabora Viewers by Document"
expr: 'doc_views_active > {{ $value }}'
for: "1m"
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "Too many Viewers on a document in namespace: {{ $labels.namespace }}"
`}}
{{- end }}
{{- range $key, $value := .Values.prometheus.rules.defaults.viewers.sum }}
- alert: "Collabora Viewers by Namespace"
expr: 'sum(document_active_views_active_count_total) without (instance, pod) > {{ $value }}'
for: "1m"
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "Too many Viewers on namespace"
`}}
{{- end }}
- alert: "Collabora same Document open Multiple time"
expr: 'count(doc_pid) by (key) > 1'
labels:
severity: "warning"
{{`
annotations:
summary: "a key/document is open multiple times in namespace: {{ $labels.namespace }}"
`}}
- alert: "Collabora same Document open Multiple time"
expr: 'count(count(doc_pid)by(key)>1) > {{ .Values.prometheus.rules.defaults.docs.duplicated }}'
labels:
severity: "critical"
{{`
annotations:
summary: "too many document are open multiple times in namespace: {{ $labels.namespace }}"
`}}
- alert: "Collabora Error StorageSpaceLow"
expr: 'increase(error_storage_space_low[1m]) > 0'
labels:
severity: "warning"
{{`
annotations:
summary: "local storage space too low to operate in namespace: {{ $labels.namespace }}"
`}}
{{- range $key, $value := .Values.prometheus.rules.defaults.errorStorageConnections }}
- alert: "Collabora Error StorageConnection"
expr: 'increase(error_storage_connection[1m]) > {{ $value }}'
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "unable to connect to storage in namespace {{ $labels.namespace }} on pod {{ $labels.pod }}."
`}}
{{- end }}
- alert: "Collabora Error BadRequest"
expr: 'increase(error_bad_request[1m]) > 0'
labels:
severity: "warning"
{{`
annotations:
summary: "we returned an HTTP bad request to a caller in namespace: {{ $labels.namespace }}"
`}}
- alert: "Collabora Error BadArgument"
expr: 'increase(error_bad_argument[1m]) > 0'
labels:
severity: "warning"
{{`
annotations:
summary: "we returned an HTTP bad argument to a caller in namespace: {{ $labels.namespace }}"
`}}
- alert: "Collabora Error UnauthorizedRequest"
expr: 'increase(error_unauthorized_request[1m]) > 0'
labels:
severity: "warning"
{{`
annotations:
summary: "an authorization exception usually on CheckFileInfo in namespace: {{ $labels.namespace }}"
`}}
{{- range $key, $value := .Values.prometheus.rules.defaults.errorServiceUnavailable }}
- alert: "Collabora Error ServiceUnavailable"
expr: 'increase(error_service_unavailable[1m]) > {{ $value }}'
labels:
severity: "{{ $key }}"
{{`
annotations:
summary: "internal error, service is unavailable in namespace {{ $labels.namespace }} on pod {{ $labels.pod }}."
`}}
{{- end }}
- alert: "Collabora Error ParseError"
expr: 'increase(error_parse_error[1m]) > 0'
labels:
severity: "warning"
{{`
annotations:
summary: "badly formed data provided for us to parse in namespace: {{ $labels.namespace }}"
`}}
{{- end }}
{{- if .Values.prometheus.rules.additionalRules }}
- name: {{ template "collabora-online.name" . }}-Additional
rules: {{- toYaml .Values.prometheus.rules.additionalRules | nindent 4 }}
{{- end }}
{{- end }}