diff --git a/apps/k8s01/iot/kustomization.yaml b/apps/k8s01/iot/kustomization.yaml index b66bcfa2a2ffd343a138ce8bf86351a144d51fa5..ccee6fc2c71c5573b8b2ac28684d348cadb76942 100644 --- a/apps/k8s01/iot/kustomization.yaml +++ b/apps/k8s01/iot/kustomization.yaml @@ -8,3 +8,4 @@ resources: - rainer.yaml - shelly.yaml - shelly-ht-monitor.yaml +- monitoring.yaml diff --git a/apps/k8s01/iot/monitoring.yaml b/apps/k8s01/iot/monitoring.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c6a1aa859a964762e4f723727b46235107d9f2d8 --- /dev/null +++ b/apps/k8s01/iot/monitoring.yaml @@ -0,0 +1,75 @@ +--- +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: shelly-rules + namespace: iot +spec: + groups: + - name: shelly-plugs + rules: + - alert: K8sEnergyUsageHigh + annotations: + description: The Kubernetes Cluster has been using more than 100 Watts per minute for the past 6 hours. + summary: The Kubernetes Cluster has been using more than 100 Watts per minute for the past 6 hours. + expr: sum(avg_over_time(shelly_meter_power_watts{target!="shelly01"}[1m])) > 100 + for: 6h + labels: + issue: Check your K8s cluster, it's drawing a lot of power! + severity: warning + - name: shelly-ht + rules: + - alert: HumidityHighWarning + annotations: + description: The humidity of a room/sensor has exceeded 65% over the past 6 hours. + summary: The humidity of a room/sensor has exceeded 65% over the past 6 hours. + expr: avg_over_time(shellyht_humidity_percent[10m]) > 65 + for: 6h + labels: + issue: Humidity in {{$labels.name}} is too high. Open a window! + severity: warning + - alert: HumidityHighCritical + annotations: + description: The humidity of a room/sensor has exceeded 80% over the past 30 minutes. + summary: The humidity of a room/sensor has exceeded 80% over the past 30 minutes. + expr: avg_over_time(shellyht_humidity_percent[1m]) > 80 + for: 30m + labels: + issue: Humidity in {{$labels.name}} is too high. Open a window! + severity: critical + - alert: TempratureHighWarning + annotations: + description: The temprature of a room/sensor has exceeded 25°C over the past 6 hours. + summary: The temprature of a room/sensor has exceeded 25°C over the past 6 hours. + expr: avg_over_time(shellyht_temperature_celsius[10m]) > 25 + for: 6h + labels: + issue: Temprature in {{$labels.name}} is high. Open a window! + severity: warning + - alert: TempratureHighCritical + annotations: + description: The temprature of a room/sensor has exceeded 28°C over the past 30 minutes. + summary: The temprature of a room/sensor has exceeded 28°C over the past 30 minutes. + expr: avg_over_time(shellyht_temperature_celsius[1m]) > 28 + for: 30m + labels: + issue: Temprature in {{$labels.name}} is too high. Open a window! + severity: critical + - alert: TempratureLowWarning + annotations: + description: The temprature of a room/sensor has dropped below 20°C over the past 6 hours. + summary: The temprature of a room/sensor has dropped below 20°C over the past 6 hours. + expr: avg_over_time(shellyht_temperature_celsius[10m]) > 20 + for: 6h + labels: + issue: Temprature in {{$labels.name}} is low. Turn up the heating! + severity: warning + - alert: TempratureHighCritical + annotations: + description: The temprature of a room/sensor has dropped below 18°C over the past 30 minutes. + summary: The temprature of a room/sensor has dropped below 18°C over the past 30 minutes. + expr: avg_over_time(shellyht_temperature_celsius[1m]) < 18 + for: 30m + labels: + issue: Temprature in {{$labels.name}} is too low. Turn up the heating! + severity: critical \ No newline at end of file