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

Refactoring of 'replaceToken' code which changes PrometheusRules #2822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aruniiird
Copy link
Contributor

Added more details to 'replaceToken' struct which give more details about where the change is going to be reflected in the rule. Added more usecases to tests.

Copy link
Contributor

openshift-ci bot commented Sep 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aruniiird
Once this PR has been reviewed and has the lgtm label, please assign blaineexe for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@aruniiird aruniiird force-pushed the refactor-prometheusrule-replaceToken-code branch 2 times, most recently from 417a269 to 2dae404 Compare September 26, 2024 15:46
Added more details to 'replaceToken' struct which give more details
about where the change is going to be reflected in the rule.
Added usecases to tests.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
@aruniiird aruniiird force-pushed the refactor-prometheusrule-replaceToken-code branch from 2dae404 to 3623839 Compare September 27, 2024 06:46
Copy link
Contributor

openshift-ci bot commented Sep 27, 2024

@aruniiird: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocs-operator-bundle-e2e-aws 3623839 link true /test ocs-operator-bundle-e2e-aws

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link
Contributor

@malayparida2000 malayparida2000 left a comment

Choose a reason for hiding this comment

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

The initial idea of not specifying rule names for the osd/cluster utilization numbers was due to the fact that they were being changed across multiple rules, and we wanted the value to be replaced in all the rules. So if we want to cover it with particular rules we have to be careful to cover them in all the rules they appear.

createReplaceToken("", "", "0.75", fmt.Sprintf("%f", *specifiedNearFullRatio)))
createReplaceToken("cluster-utilization-alert.rules", "CephClusterNearFull",
"75%", fmt.Sprintf("%0.0f%%", *specifiedNearFullRatio*100), AnnotationRuleSection, DescriptionKey),
createReplaceToken("cluster-utilization-alert.rules", "CephClusterNearFull",
Copy link
Contributor

Choose a reason for hiding this comment

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

75 % & 0.75 needs to be replaced in CephClusterNearFull & CephOSDNearFull both

createReplaceToken("", "", "80%", fmt.Sprintf("%.2f%%", *specifiedBackfillFullRatio*100)),
createReplaceToken("", "", "0.80", fmt.Sprintf("%f", *specifiedBackfillFullRatio)))
createReplaceToken("cluster-utilization-alert.rules", "CephClusterCriticallyFull",
"80%", fmt.Sprintf("%0.0f%%", *specifiedBackfillFullRatio*100), AnnotationRuleSection, DescriptionKey),
Copy link
Contributor

Choose a reason for hiding this comment

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

80%/0.80 needs to replaced in CephClusterCriticallyFull & CephOSDCriticallyFull.

createReplaceToken("", "", "85%", fmt.Sprintf("%.2f%%", *specifiedFullRatio*100)),
createReplaceToken("", "", "0.85", fmt.Sprintf("%f", *specifiedFullRatio)))
createReplaceToken("cluster-utilization-alert.rules", "CephClusterReadOnly",
"85%", fmt.Sprintf("%0.0f%%", *specifiedFullRatio*100), AnnotationRuleSection, DescriptionKey),
Copy link
Contributor

Choose a reason for hiding this comment

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

85% needs to be replaced in CephClusterNearFull, CephClusterCriticallyFull, CephClusterReadOnly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants