-
Notifications
You must be signed in to change notification settings - Fork 136
[kubevirt-operator] Fix typo in VMNotRunningFor10Minutes alert #1770
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
Conversation
Fix case sensitivity in status check: "running" → "Running". The metric uses "Running" (capital R), so the lowercase check was always triggering alerts even for running VMs. Fixes: #1552 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
📝 WalkthroughWalkthroughCorrects a case-sensitivity typo in a Prometheus alert rule for KubeVirt, changing the status filter from lowercase "running" to uppercase "Running" to match the actual metric values, fixing incorrect alert triggering for running VMs. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)packages/system/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.yaml📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @lexfrei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue causing false positive alerts for running virtual machines by correcting a case sensitivity mismatch in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly fixes a case-sensitivity typo in the VMNotRunningFor10Minutes alert, which was causing false positives. The change from running to Running is accurate. I've also included a suggestion to improve the logic of the alert expression itself. Using min_over_time instead of max_over_time will make the alert more reliable by ensuring it only fires when a VM has been in a non-running state for the full 10-minute duration, which aligns better with the alert's name and intent. This would help reduce alert fatigue from transient states.
|
Successfully created backport PR for |
Revert PR #1770 which incorrectly changed status check from lowercase to uppercase. The actual metrics use lowercase: - kubevirt_vm_info uses status="running" (not "Running") - kubevirt_vmi_info uses phase="running" (not "Running") Verified by querying virt-controller metrics in instories cluster. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
## What this PR does Reverts PR #1770 which incorrectly changed status/phase checks from lowercase to uppercase. The actual KubeVirt metrics use **lowercase**: - `kubevirt_vm_info` uses `status="running"` (not `"Running"`) - `kubevirt_vmi_info` uses `phase="running"` (not `"Running"`) ### Verification Queried virt-controller metrics directly in the instories cluster: ``` kubevirt_vm_info{...,status="running",status_group="running",...} 1 kubevirt_vmi_info{...,phase="running",...} 1 ``` Note: `kubectl get vm` shows `STATUS: Running` with capital R, but this is display formatting — the actual metric labels use lowercase. ### Release note ```release-note [kubevirt-operator] Fix VM alert rules to use correct lowercase status values ```
Revert PR #1770 which incorrectly changed status check from lowercase to uppercase. The actual metrics use lowercase: - kubevirt_vm_info uses status="running" (not "Running") - kubevirt_vmi_info uses phase="running" (not "Running") Verified by querying virt-controller metrics in instories cluster. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la> (cherry picked from commit 36836fd)
Revert PR #1770 which incorrectly changed status check from lowercase to uppercase. The actual metrics use lowercase: - kubevirt_vm_info uses status="running" (not "Running") - kubevirt_vmi_info uses phase="running" (not "Running") Verified by querying virt-controller metrics in instories cluster. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la> (cherry picked from commit 36836fd)
## What this PR does Fix case sensitivity in status check for VMNotRunningFor10Minutes alert rule. The metric `kubevirt_vm_info` uses `status="Running"` (capital R), but the alert rule was checking for `status!="running"` (lowercase), causing false alerts for running VMs. Fixes #1552 ### Release note ```release-note [kubevirt-operator] Fix VMNotRunningFor10Minutes alert false positives ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed alert rule condition for virtual machine status detection to ensure proper matching of running VMs. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does Reverts PR #1770 which incorrectly changed status/phase checks from lowercase to uppercase. The actual KubeVirt metrics use **lowercase**: - `kubevirt_vm_info` uses `status="running"` (not `"Running"`) - `kubevirt_vmi_info` uses `phase="running"` (not `"Running"`) ### Verification Queried virt-controller metrics directly in the instories cluster: ``` kubevirt_vm_info{...,status="running",status_group="running",...} 1 kubevirt_vmi_info{...,phase="running",...} 1 ``` Note: `kubectl get vm` shows `STATUS: Running` with capital R, but this is display formatting — the actual metric labels use lowercase. ### Release note ```release-note [kubevirt-operator] Fix VM alert rules to use correct lowercase status values ```
## What this PR does Fix case sensitivity in status check for VMNotRunningFor10Minutes alert rule. The metric `kubevirt_vm_info` uses `status="Running"` (capital R), but the alert rule was checking for `status!="running"` (lowercase), causing false alerts for running VMs. Fixes #1552 ### Release note ```release-note [kubevirt-operator] Fix VMNotRunningFor10Minutes alert false positives ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed alert rule condition for virtual machine status detection to ensure proper matching of running VMs. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does Reverts PR #1770 which incorrectly changed status/phase checks from lowercase to uppercase. The actual KubeVirt metrics use **lowercase**: - `kubevirt_vm_info` uses `status="running"` (not `"Running"`) - `kubevirt_vmi_info` uses `phase="running"` (not `"Running"`) ### Verification Queried virt-controller metrics directly in the instories cluster: ``` kubevirt_vm_info{...,status="running",status_group="running",...} 1 kubevirt_vmi_info{...,phase="running",...} 1 ``` Note: `kubectl get vm` shows `STATUS: Running` with capital R, but this is display formatting — the actual metric labels use lowercase. ### Release note ```release-note [kubevirt-operator] Fix VM alert rules to use correct lowercase status values ```
Revert PR #1770 which incorrectly changed status check from lowercase to uppercase. The actual metrics use lowercase: - kubevirt_vm_info uses status="running" (not "Running") - kubevirt_vmi_info uses phase="running" (not "Running") Verified by querying virt-controller metrics in instories cluster. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la> (cherry picked from commit 36836fd)
## What this PR does Fix case sensitivity in status check for VMNotRunningFor10Minutes alert rule. The metric `kubevirt_vm_info` uses `status="Running"` (capital R), but the alert rule was checking for `status!="running"` (lowercase), causing false alerts for running VMs. Fixes #1552 ### Release note ```release-note [kubevirt-operator] Fix VMNotRunningFor10Minutes alert false positives ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed alert rule condition for virtual machine status detection to ensure proper matching of running VMs. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does Reverts PR #1770 which incorrectly changed status/phase checks from lowercase to uppercase. The actual KubeVirt metrics use **lowercase**: - `kubevirt_vm_info` uses `status="running"` (not `"Running"`) - `kubevirt_vmi_info` uses `phase="running"` (not `"Running"`) ### Verification Queried virt-controller metrics directly in the instories cluster: ``` kubevirt_vm_info{...,status="running",status_group="running",...} 1 kubevirt_vmi_info{...,phase="running",...} 1 ``` Note: `kubectl get vm` shows `STATUS: Running` with capital R, but this is display formatting — the actual metric labels use lowercase. ### Release note ```release-note [kubevirt-operator] Fix VM alert rules to use correct lowercase status values ```
What this PR does
Fix case sensitivity in status check for VMNotRunningFor10Minutes alert rule.
The metric
kubevirt_vm_infousesstatus="Running"(capital R), but the alert rule was checking forstatus!="running"(lowercase), causing false alerts for running VMs.Fixes #1552
Release note
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.