fix(mycloud-nextcloud): improve metrics and alerts (workaround)
This commit is contained in:
parent
d08028c2aa
commit
3b80a91678
2 changed files with 45 additions and 0 deletions
|
@ -215,6 +215,11 @@ spec:
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
image:
|
||||||
|
tag: 0.8.0
|
||||||
|
info:
|
||||||
|
apps: true
|
||||||
|
update: true
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
|
|
40
mycloud-nextcloud/templates/rules.yaml
Normal file
40
mycloud-nextcloud/templates/rules.yaml
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{{- if (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }}
|
||||||
|
---
|
||||||
|
# workaround till https://github.com/nextcloud/helm/pull/694 is merged
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PrometheusRule
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml .Values.commons.prometheus.rules.labels | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: {{ .Release.Name }}-Defaults
|
||||||
|
rules:
|
||||||
|
- alert: "nextcloud: not reachable"
|
||||||
|
expr: 'avg(nextcloud_last_update_seconds{ }) without(endpoint,container,pod,instance) < 1'
|
||||||
|
labels:
|
||||||
|
severity: "critical"
|
||||||
|
{{`
|
||||||
|
annotations:
|
||||||
|
summary: "Nextcloud in {{ $labels.namespace }} is not reachable by exporter"
|
||||||
|
`}}
|
||||||
|
|
||||||
|
- alert: "nextcloud: outdated version"
|
||||||
|
expr: 'sum(nextcloud_system_update_available{ }) without(endpoint,container,pod,instance) > 0'
|
||||||
|
labels:
|
||||||
|
severity: "warning"
|
||||||
|
{{`
|
||||||
|
annotations:
|
||||||
|
summary: "Nextcloud in {{ $labels.namespace }} is outdated"
|
||||||
|
`}}
|
||||||
|
|
||||||
|
- alert: "nextcloud: outdated apps"
|
||||||
|
expr: 'sum(nextcloud_apps_updates_available_total{ }) without(endpoint,container,pod,instance) > 0'
|
||||||
|
labels:
|
||||||
|
severity: "warning"
|
||||||
|
{{`
|
||||||
|
annotations:
|
||||||
|
summary: "Nextcloud in {{ $labels.namespace }} has {{ $value }} outdated Apps"
|
||||||
|
`}}
|
||||||
|
{{- end }}
|
Loading…
Add table
Reference in a new issue