{{- if (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }} --- apiVersion: "monitoring.coreos.com/v1" kind: "PrometheusRule" metadata: name: prometheus-node-exporter labels: {{- toYaml .Values.commons.prometheus.rules.labels | nindent 4 }} spec: groups: - name: "Node disk rate" rules: - alert: HostUnusualDiskReadRate expr: '(sum by (instance) (rate(node_disk_read_bytes_total[2m])) / 1024 / 1024 > 50) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' for: "5m" labels: severity: "warning" detectedBy: "NodeExporter" annotations: {{` summary: "Host unusual disk read rate (instance {{ $labels.instance }})" description: "Disk is probably reading too much data (> 50 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" `}} - alert: HostUnusualDiskWriteRate expr: '(sum by (instance) (rate(node_disk_written_bytes_total[2m])) / 1024 / 1024 > 50) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' for: "2m" labels: severity: "warning" detectedBy: "NodeExporter" annotations: {{` summary: "Host unusual disk write rate (instance {{ $labels.instance }})" description: "Disk is probably writing too much data (> 50 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" `}} - name: "ZFS" rules: - alert: ZFSOfflinePool expr: 'node_zfs_zpool_state{state!="online"} > 0' for: "1m" labels: severity: "critical" detectedBy: "NodeExporter" annotations: {{` summary: "ZFS offline pool (instance {{ $labels.instance }})" description: "A ZFS zpool is in a unexpected state: {{ $labels.state }}.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" `}} - name: "Hardware Temperature" rules: - alert: HostPhysicalComponentTooHot expr: 'avg(node_hwmon_temp_crit_alarm_celsius * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}) without(container,endpoint,instance,pod,service,namespace,job) > 0' for: "0m" labels: severity: "critical" detectedBy: "NodeExporter" annotations: {{` summary: Host node overtemperature alarm (node {{ $labels.nodename }}) description: "Physical node temperature alarm triggered\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" `}} - alert: HostPhysicalComponentTooHot expr: 'avg((node_hwmon_temp_celsius > node_hwmon_temp_max_celsius) * ignoring(label) group_left(instance,chip,sensor) node_hwmon_sensor_label{} * on(instance) group_left (nodename) node_uname_info{nodename=~".+"} ) without(container,endpoint,instance,pod,service,namespace,job)' for: "5m" labels: severity: "warning" detectedBy: "NodeExporter" annotations: {{` summary: Host physical component too hot (node {{ $labels.nodename }}) description: "Physical hardware component too hot\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" `}} {{- end }}