use crate::modules::monitoring::alert_rule::prometheus_alert_rule::PrometheusAlertRule;

pub fn high_pvc_fill_rate_over_two_days() -> PrometheusAlertRule {
    PrometheusAlertRule::new(
        "PVC Fill Over 95 Percent In 2 Days",
        "(kubelet_volume_stats_used_bytes/kubelet_volume_stats_capacity_bytes) > 0.95 AND predict_linear(kubelet_volume_stats_used_bytes[2d], 2 * 24 * 60 * 60)/kubelet_volume_stats_capacity_bytes > 0.95",)
        .for_duration("1m")
        .label("severity", "warning")
        .annotation("summary", "The PVC {{ $labels.persistentvolumeclaim }} in namespace {{ $labels.namespace }} is predicted to fill over 95% in less than 2 days.")
        .annotation("description", "PVC {{ $labels.persistentvolumeclaim }} in namespace {{ $labels.namespace }} will fill over 95% in less than 2 days",)
}
