Predict disk full window prometheus
alert when linear trend predicts disk full within 4h based on last 6h
predict_linear(node_filesystem_avail_bytes{mountpoint="/"}[6h], 4*3600) < 0
more prometheus
all 30 commands →
Detect dead target with absent
absent(up{job="node"} == 1)
Rewrite label with label_replace
label_replace(node_uname_info, "host", "$1", "nodename", "(.+)")
Max of per-second rate over window
max_over_time(rate(node_network_receive_bytes_total[5m])[1h:1m])
Aggregate keeping all labels but instance
sum without(instance) (rate(http_requests_total{code=~"5.."}[5m]))
Recording rule for expensive ratio
groups:
- name: slo
rules:
- record: job:request_errors:ratio5m
expr: sum by(job)(rate(http_requests_total{code=~"5.."}[5m])) / sum by(job)(rate(http_requests_total[5m]))