Bug 2209046 - kubevirt_vmi_cpu_affinity metric is enriched with an excessive amount of labels [NEEDINFO]
Summary: kubevirt_vmi_cpu_affinity metric is enriched with an excessive amount of labels
Keywords:
Status: MODIFIED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Metrics
Version: 4.12.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.14.0
Assignee: João Vilaça
QA Contact: Ahmad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-22 12:23 UTC by Shirly Radco
Modified: 2023-08-11 10:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
kmajcher: needinfo? (jvilaca)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 10070 0 None Merged Remove affinities label from kubevirt_vmi_cpu_affinity and use sum as value 2023-08-10 15:44:21 UTC
Github kubevirt kubevirt pull 10266 0 None Merged [release-1.0] Remove affinities label from kubevirt_vmi_cpu_affinity and use sum as value 2023-08-11 10:45:56 UTC
Red Hat Issue Tracker CNV-28961 0 None None None 2023-05-22 12:25:40 UTC

Description Shirly Radco 2023-05-22 12:23:50 UTC
Description of problem:
Issue reported in https://github.com/kubevirt/kubevirt/issues/9713.

In https://github.com/kubevirt/kubevirt/pull/5191 the kubevirt_vmi_cpu_affinity metric got introduced. Given X pcpus and Y vcpus, there can be up to X*Y labels generated for a single VM.

A concrete example: 192 pcore and 48 vcpu lead to 48*192 (9216!) labels. This is something which can not easily be digested by all kinds of metric pipelines.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Starting a VM with a single vCPU without explicit pinning, has an affinity for all CPUs.
2.
3.

Actual results:


Expected results:
Let's see that we shrink or remove this. Since this is "just" a boolean map expressing CPU pinning layout, this looks like something which should not be exposed via core kubevirt via prometheus metrics.

Just doing this for explicit cpu pinning may be an option, but even then getting 50-100 labels would be the result which is probably still above an acceptable number of labels per metric, considering that VM labels and such are added as well and we want to leave room for user-specific labels.

Additional info:
Example for a single vCPU on a 8-core machine:

# virsh vcpuinfo default_fedora
VCPU:           0
CPU:            4
State:          running
CPU time:       33.5s
CPU Affinity:   yyyyyyyy

Note the 8 `y`s

Comment 1 Krzysztof Majcher 2023-08-08 12:51:34 UTC
Please also backport to release-1.0

Comment 2 Simone Tiraboschi 2023-08-10 15:44:45 UTC
https://github.com/kubevirt/kubevirt/pull/10266 is still open, moving back to post


Note You need to log in before you can comment on or make changes to this bug.