-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kubevirt_vm/i_vnic_info metrics #13610
Conversation
Skipping CI for Draft Pull Request. |
72bb514
to
95efe1f
Compare
1aea25e
to
3e5df14
Compare
@EdDev @orelmisan Will appreciate your review |
953e71f
to
eded0a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CollectVmsVnicInfo
and the CollectVmisVnicInfo
functions are very similar and contains a lot of duplicate code. I'm sure we can take parts of this functions into common functions.
For example, this code:
switch {
case iface.Masquerade != nil:
bindingType = "masquerade"
case iface.Bridge != nil:
bindingType = "bridge"
case iface.SRIOV != nil:
bindingType = "sriov"
case iface.Binding != nil:
bindingType = "binding"
bindingValue = iface.Binding.Name
}
Can be changed into something like:
func getBinding(iface) (string,string {
bindingType := none
bindingValue := none
switch {
case iface.Masquerade != nil:
bindingType = "masquerade"
case iface.Bridge != nil:
bindingType = "bridge"
case iface.SRIOV != nil:
bindingType = "sriov"
case iface.Binding != nil:
bindingType = "binding"
bindingValue = iface.Binding.Name
}
return bindingType, bindingValue
}
...
bindingType, bindingValue := getBinding(iface)
c4ae353
to
4ce02d6
Compare
@avlitman |
pkg/monitoring/metrics/virt-controller/vmistats_collector_test.go
Outdated
Show resolved
Hide resolved
Yes we have cases like this for vms but not for vmi, vmi should contain the interface and network information all the time. and the vm shows this info only when both network and interface applied in the vm yaml (you have to define both- if not it fail to create the vm) |
4ce02d6
to
4387541
Compare
b3a2f16
to
c578d6c
Compare
c578d6c
to
c5631b4
Compare
3a32970
to
62ee268
Compare
It is a valid configuration to have a VM with no network interfaces. |
Signed-off-by: avlitman <[email protected]>
62ee268
to
11e8679
Compare
@avlitman: The
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test pull-kubevirt-check-tests-for-flakes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sradco The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Required labels detected, running phase 2 presubmits: |
/retest-required |
What this PR does
Add 2 metrics that reports the vNIC information for vm's and vmi's.
the metrics labels includes:
- name: the vm/i name
- namespace: the vm/i namespace
- vnic_name: the interface name
- binding_type: can be core/plugin
- network: if using Pod it will be "pod networking", if using Multus it will be the Multus.NetworkName.
- binding_name: can be masquerade/bridge/sriov/Binding.Name
see metrics:

notes:
Fixes #
jira-ticket: https://issues.redhat.com/browse/CNV-51529
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note