Skip to content
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

Fix kubevirt_vmi_phase_count not being created #10001

Conversation

machadovilaca
Copy link
Member

@machadovilaca machadovilaca commented Jun 28, 2023

What this PR does / why we need it:

kubevirt_vmi_phase_count was not being created because a label was missing

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2211512

Special notes for your reviewer:

Release note:

Fix kubevirt_vmi_phase_count not being created

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/M labels Jun 28, 2023
@enp0s3
Copy link
Contributor

enp0s3 commented Jun 28, 2023

/cc

@kubevirt-bot kubevirt-bot requested a review from enp0s3 June 28, 2023 14:22
@@ -250,7 +250,7 @@ func (co *VMICollector) updateVMIsPhase(vmis []*k6tv1.VirtualMachineInstance, ch
mv, err := prometheus.NewConstMetric(
vmiCountDesc, prometheus.GaugeValue,
float64(count),
vmc.NodeName, vmc.Phase, vmc.OS, vmc.Workload, vmc.Flavor, vmc.InstanceType,
vmc.NodeName, vmc.Phase, vmc.OS, vmc.Workload, vmc.Flavor, vmc.InstanceType, vmc.Preference,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate on why the absence of vmc.Preference caused the metric to not be pushed and not to be collected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewConstMetric was throwing an error saying the number of labels set in vmiCountDesc and the number of labels used as arguments differed. The issue was being logged.

Also, the unit tests were incomplete, testing only the reading of the VMIs details, and were missing the creation of the metric

@machadovilaca machadovilaca force-pushed the fix-missing-label-kubevirt_vmi_phase_count branch from 09374fb to 9fb57e3 Compare July 4, 2023 13:15
Signed-off-by: João Vilaça <jvilaca@redhat.com>
@machadovilaca machadovilaca force-pushed the fix-missing-label-kubevirt_vmi_phase_count branch from 9fb57e3 to dc57225 Compare July 4, 2023 13:36
Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2023
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enp0s3

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 5, 2023
@kubevirt-bot kubevirt-bot merged commit 534bda1 into kubevirt:main Jul 5, 2023
36 checks passed
@machadovilaca
Copy link
Member Author

/cherry-pick release-1.0

@kubevirt-bot
Copy link
Contributor

@machadovilaca: new pull request created: #10051

In response to this:

/cherry-pick release-1.0

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/test-infra repository.

@machadovilaca
Copy link
Member Author

/cherry-pick release-0.59

1 similar comment
@machadovilaca
Copy link
Member Author

/cherry-pick release-0.59

@kubevirt-bot
Copy link
Contributor

@machadovilaca: new pull request created: #10483

In response to this:

/cherry-pick release-0.59

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/monitoring dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants