Skip to content

Commit

Permalink
longhorn: add alert about FS trimming
Browse files Browse the repository at this point in the history
Signed-off-by: paulfantom <[email protected]>
  • Loading branch information
paulfantom committed Jan 21, 2025
1 parent d7c9f8f commit 7a90705
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions base/longhorn-system/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ metadata:
namespace: monitoring
spec:
groups:
- name: longhorn-test.rules
rules:
- alert: LonghornVolumeTrimNeeded
annotations:
description: PVC {{$labels.persistentvolumeclaim}} in namespace {{$labels.namespace}} needs to be trimmed.
summary: Longhorn volume needs to be trimmed
expr: |
(kubelet_volume_stats_capacity_bytes - kubelet_volume_stats_available_bytes)
/ on(namespace,persistentvolumeclaim) group_left
label_replace(
label_replace(
longhorn_volume_actual_size_bytes, "persistentvolumeclaim", "$1", "pvc", "(.+)"
),
"namespace", "$1", "pvc_namespace", "(.+)"
)
< 0.5
AND
(kubelet_volume_stats_capacity_bytes - kubelet_volume_stats_available_bytes) > 1024*1024*1024
for: 2d
labels:
severity: warning
- name: longhorn.rules
rules:
- alert: LonghornVolumeActualSpaceUsedWarning
Expand Down

0 comments on commit 7a90705

Please sign in to comment.