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

Refactor monitoring recording-rules #10651

Merged

Conversation

machadovilaca
Copy link
Member

@machadovilaca machadovilaca commented Oct 30, 2023

What this PR does / why we need it:

Following the work started in #10044, and according to the kubevirt/community#219 proposal, this PR:

  • refactors recording rules and precedes a following PR to also refactor alerts, in a similar way

  • updates the old name of the github.com/coreos/prometheus-operator dependency to github.com/prometheus-operator/prometheus-operator

  • replaces the usage of k8s.io/utils/pointer with k8s.io/utils/ptr, because with the deps updates k8s.io/utils/pointer became deprecated


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:

Refactor monitoring  recording-rules

JIRA ticket:

https://issues.redhat.com/browse/CNV-27303

@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XXL area/monitoring labels Oct 30, 2023
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch 5 times, most recently from c1c0f74 to b9137e2 Compare October 31, 2023 12:21
@machadovilaca
Copy link
Member Author

/test all

@machadovilaca machadovilaca marked this pull request as ready for review October 31, 2023 15:34
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 2023
@machadovilaca
Copy link
Member Author

/cc @enp0s3

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2023
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch from b9137e2 to e819f91 Compare November 7, 2023 23:20
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2023
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.

@machadovilaca Hi, thank you for taking care of it! Can you please elaborate in the PR description on the need to bump the vendor packages?

hack/dep-update.sh Outdated Show resolved Hide resolved
@@ -253,7 +253,7 @@ Returns the total number of virtual machine disks restored from the source virtu
Returns the amount of space in bytes restored from the source virtual machine. Type: Gauge.

### kubevirt_vmsnapshot_persistentvolumeclaim_labels
Returns the labels of the persistent volume claims that are used for restoring virtual machines. Type: Info.
Returns the labels of the persistent volume claims that are used for restoring virtual machines. Type: Gauge.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change related to the refactoring or is it a bug you've fixed?

Copy link
Member Author

Choose a reason for hiding this comment

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

50/50, metric type Info does not exist: https://prometheus.io/docs/concepts/metric_types/

and therefore the package does not provide it

pkg/monitoring/rules/recording_rules_api.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/recording_rules_nodes.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/recording_rules_virt.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/recording_rules_vm.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/recording_rules_vmi.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/recording_rules_vmsnapshot.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/rules.go Show resolved Hide resolved
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch from e819f91 to 66b0f98 Compare November 8, 2023 11:22
@machadovilaca
Copy link
Member Author

updated @enp0s3

@machadovilaca machadovilaca mentioned this pull request Nov 8, 2023
8 tasks
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2023
…rometheus-operator/prometheus-operator

Signed-off-by: João Vilaça <jvilaca@redhat.com>
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch from 66b0f98 to 9716c52 Compare November 15, 2023 14:45
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2023
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch from 3c42cac to ccef0ff Compare November 15, 2023 15:37
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
@machadovilaca machadovilaca force-pushed the refactor-monitoring-recording-rules branch from 9a3179b to 4b924d8 Compare November 15, 2023 16:12
@machadovilaca
Copy link
Member Author

/retest

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.

@machadovilaca Thank you!

/approve

@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 Nov 24, 2023
Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

/hold
@enp0s3

@@ -29,7 +29,7 @@ done
echo $_sync_only
cd staging/src/kubevirt.io/client-go
if [ "${_sync_only}" == "false" ]; then go get $@ ./...; fi
go mod tidy
go mod tidy -compat=1.17
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

@xpivarc Thanks! @machadovilaca I think I commented on it in the previous review cycle, why did you still keep it?

Copy link
Member Author

Choose a reason for hiding this comment

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

my bad, sorry, this was indeed resolved in a previous interaction, but after some reviews eventually it was changed back because we then discussed some unnecessary dependency updates in staging/src/kubevirt.io/client-go/go.mod, namely, onsi/ginkgo/v2 and onsi/gomega, that didn't seem necessary

by default the flag defaults to ensure compatibility with the previous version (-compat=1.16 since this go.mod declares go 1.17) which causes dependency incompatibilities and required manual updates of many dependencies, this change guaranties compatibility with declared go 1.17

an alternative to -compat=1.17 addition would be adding on top off this PR changes this commit: f348aca

@enp0s3 @xpivarc

Copy link
Member

Choose a reason for hiding this comment

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

The required changes look good.

Copy link
Member Author

Choose a reason for hiding this comment

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

added @xpivarc

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2023
To ensure compatibility we need to update some
client-go dependencies after the update of
other related dependencies

Signed-off-by: João Vilaça <jvilaca@redhat.com>
@xpivarc
Copy link
Member

xpivarc commented Nov 28, 2023

/hold cancel

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 28, 2023
@sradco
Copy link
Contributor

sradco commented Nov 28, 2023

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 28, 2023
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit cfc6075 into kubevirt:main Nov 29, 2023
39 checks passed
@machadovilaca machadovilaca mentioned this pull request Jan 24, 2024
8 tasks
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/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants