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
Bug 1992567: jsonnet: cleanup jsonnet codebase and align with kube-prometheus #1315
Bug 1992567: jsonnet: cleanup jsonnet codebase and align with kube-prometheus #1315
Conversation
a8d1df9
to
ea8b82a
Compare
|
||
// shorthand for rule patching, rule excluding, and runbook_url removal | ||
sanitizeAlertRules(o): { | ||
[k]: $.removeRunbookAnnotation($.patchRule($.excludeRule(o[k]))) |
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.
This is a slight performance optimization as it will iterate only once over all objects instead of doing this 3 times.
|
||
// shorthand for rule patching, rule excluding, and runbook_url removal | ||
sanitizeAlertRules(o): { | ||
[k]: $.removeRunbookAnnotation($.patchRule($.excludeRule(o[k]))) |
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.
Shouldn't this call removeRunbookUrl
instead of removeRunbookAnnotation
?
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.
removeRunbookUrl
was already taken in https://github.com/openshift/cluster-monitoring-operator/pull/1315/files#diff-9425bc6534201e7b9f2c51476ae71ce5e7c9a353c12c58ec44008c7f12d0171fR131 and I didn't want to cause confusion by using the same name.
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.
I got confused by https://github.com/openshift/cluster-monitoring-operator/pull/1315/files#diff-9425bc6534201e7b9f2c51476ae71ce5e7c9a353c12c58ec44008c7f12d0171fR215-R219, do you know if this is really needed?
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.
Ah, you're right, this is confusing and unused. I removed it in latest commit.
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!
Signed-off-by: paulfantom <pawel@krupa.net.pl>
Signed-off-by: paulfantom <pawel@krupa.net.pl>
ea8b82a
to
fcc1e97
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, paulfantom 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 |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@paulfantom: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
10 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
18 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@paulfantom: This pull request references Bugzilla bug 1992567, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: 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/test-infra repository. |
/bugzilla refresh |
@paulfantom: This pull request references Bugzilla bug 1992567, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: 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/test-infra repository. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@paulfantom: All pull requests linked via external trackers have merged: Bugzilla bug 1992567 has been moved to the MODIFIED state. 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/test-infra repository. |
A cosmetic change to align with kube-prometheus and allow more visibility into each libsonnet file. I divided files into 2 groups/directories:
This leaves only a bare minimum of files in
jsonnet/
directory and thus declutters it.rules.libsonnet
file was left injsonnet/
as it is neither a component not a library.Additional changes:
add-workload-annotation.libsonnet
andadd-release-annotation.libsonnet
into one file withaddAnnotations()
functionsanitize-rules.libsonnet
based onpatch-rules.libsonnet
andremove-runbook-urls.libsonnet
with onesanitizeAlertRules()
function.thanos-ruler.libsonnet
TODOs
and simplifiedmain.jsonnet
a bitcc @dgrisonnet