-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(alert): adding sample prometheus rules for ZFSPV (#32)
Provide sample instructions on setting up prometheus via prometheus-operator and then configuring a sample rule to monitor the volume space utilization, and once available space is less than 10%, it will start firing the alert. ``` 100 * kubelet_volume_stats_available_bytes{job="kubelet"} / kubelet_volume_stats_capacity_bytes{job="kubelet"} < 10 ``` Signed-off-by: Pawan <pawan@mayadata.io>
- Loading branch information
1 parent
7094c48
commit 0b56f0a
Showing
4 changed files
with
451 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: alertmanager-service | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: web | ||
nodePort: 30093 | ||
port: 9093 | ||
protocol: TCP | ||
targetPort: web | ||
selector: | ||
alertmanager: prometheus-operator-alertmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
labels: | ||
app: prometheus-operator | ||
chart: prometheus-operator-8.5.4 | ||
heritage: Tiller | ||
release: prometheus-operator | ||
name: prometheus-operator-zfs-alertmanager.rules | ||
namespace: default | ||
spec: | ||
groups: | ||
- name: zfsalertmanager.rules | ||
rules: | ||
- alert: ZFSVolumeUsageCritical | ||
annotations: | ||
message: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim | ||
}} in Namespace {{ $labels.namespace }} is only {{ printf "%0.2f" $value | ||
}}% free. | ||
expr: | | ||
100 * kubelet_volume_stats_available_bytes{job="kubelet"} | ||
/ | ||
kubelet_volume_stats_capacity_bytes{job="kubelet"} | ||
< 10 | ||
for: 1m | ||
labels: | ||
severity: critical |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prometheus-service | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: web | ||
nodePort: 30090 | ||
port: 9090 | ||
protocol: TCP | ||
targetPort: web | ||
selector: | ||
prometheus: prometheus-operator-prometheus |
Oops, something went wrong.