Update recording rules names based on the naming convention
@@ -113,12 +113,12 @@ func NewPrometheusRuleSpec(ns string, workloadUpdatesEnabled bool) *v1.Prometheu
},
},
{
- Record: "num_of_allocatable_nodes",
+ Record: "kubevirt_allocatable_nodes_count",
Expr: intstr.FromString("count(count (kube_node_status_allocatable) by (node))"),
},
{
Alert: "LowVirtAPICount",
- Expr: intstr.FromString("(num_of_allocatable_nodes > 1) and (kubevirt_virt_api_up_total < 2)"),
+ Expr: intstr.FromString("(kubevirt_allocatable_nodes_count > 1) and (kubevirt_virt_api_up_total < 2)"),
For: "60m",
Annotations: map[string]string{
"summary": "More than one virt-api should be running if more than one worker nodes exist.",
@@ -129,12 +129,12 @@ func NewPrometheusRuleSpec(ns string, workloadUpdatesEnabled bool) *v1.Prometheu
},
},
{
- Record: "num_of_kvm_available_nodes",
- Expr: intstr.FromString("num_of_allocatable_nodes - count(kube_node_status_allocatable{resource=\"devices_kubevirt_io_kvm\"} == 0)"),
+ Record: "kubevirt_kvm_available_nodes_count",
+ Expr: intstr.FromString("kubevirt_allocatable_nodes_count - count(kube_node_status_allocatable{resource=\"devices_kubevirt_io_kvm\"} == 0)"),
},
{
Alert: "LowKVMNodesCount",
- Expr: intstr.FromString("(num_of_allocatable_nodes > 1) and (num_of_kvm_available_nodes < 2)"),
+ Expr: intstr.FromString("(kubevirt_allocatable_nodes_count > 1) and (kubevirt_kvm_available_nodes_count < 2)"),
For: "5m",
Annotations: map[string]string{
"description": "Low number of nodes with KVM resource available.",
@@ -195,7 +195,7 @@ func NewPrometheusRuleSpec(ns string, workloadUpdatesEnabled bool) *v1.Prometheu
},
{
Alert: "LowVirtControllersCount",
- Expr: intstr.FromString("(num_of_allocatable_nodes > 1) and (kubevirt_virt_controller_ready_total < 2)"),
+ Expr: intstr.FromString("(kubevirt_allocatable_nodes_count > 1) and (kubevirt_virt_controller_ready_total < 2)"),
For: "10m",
Annotations: map[string]string{
"summary": "More than one virt-controller should be ready if more than one worker node.",
@@ -248,7 +248,7 @@ func NewPrometheusRuleSpec(ns string, workloadUpdatesEnabled bool) *v1.Prometheu
},
{
Alert: "LowVirtOperatorCount",
- Expr: intstr.FromString("(num_of_allocatable_nodes > 1) and (kubevirt_virt_operator_up_total < 2)"),
+ Expr: intstr.FromString("(kubevirt_allocatable_nodes_count > 1) and (kubevirt_virt_operator_up_total < 2)"),
For: "60m",
Annotations: map[string]string{
"summary": "More than one virt-operator should be running if more than one worker nodes exist.",
