Skip to content

Commit

Permalink
Merge pull request #961 from assafad/add-labels
Browse files Browse the repository at this point in the history
Add guest OS labels to cnv:vmi_status_running:count
  • Loading branch information
kubevirt-bot authored Apr 17, 2024
2 parents ad7c7b2 + 6a64fd0 commit 1b184ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SSP Operator metrics

### cnv:vmi_status_running:count
The total number of running VMIs by status. Type: Gauge.
The total number of running VMIs, labeled with node, instance type, preference and guest OS information. Type: Gauge.

### kubevirt_ssp_common_templates_restored_increase
The increase in the number of common templates restored by the operator back to their original state, over the last hour. Type: Gauge.
Expand Down
5 changes: 3 additions & 2 deletions pkg/monitoring/rules/recordingrules/vmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ var vmiRecordingRules = []operatorrules.RecordingRule{
{
MetricsOpts: operatormetrics.MetricOpts{
Name: "cnv:vmi_status_running:count",
Help: "The total number of running VMIs by status",
Help: "The total number of running VMIs, labeled with node, instance type, preference and guest OS information",
},
MetricType: operatormetrics.GaugeType,
Expr: intstr.FromString("sum(kubevirt_vmi_phase_count{phase=\"running\"}) by (node,os,workload,flavor,instance_type,preference)"),
Expr: intstr.FromString("sum(kubevirt_vmi_phase_count{phase=\"running\"}) by " +
"(node,os,workload,flavor,instance_type,preference,guest_os_kernel_release,guest_os_machine,guest_os_name,guest_os_version_id)"),
},
}

0 comments on commit 1b184ef

Please sign in to comment.