Add hypervisor family label for flavor usage kpi#703
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe changes introduce hypervisor family detection (KVM vs VMware) to the flavor running VMs KPI plugin. A regex pattern identifies KVM flavors by name, and this classification is included as a new Prometheus metric label. Tests validate the detection logic, and a Grafana dashboard is updated to filter and group metrics by hypervisor family. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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 |
Test Coverage ReportTest Coverage 📊: 68.7% |
There was a problem hiding this comment.
Pull request overview
This PR extends the compute “flavor running VMs” KPI and its Plutono dashboard to support filtering/splitting by hypervisor family (KVM vs VMware), using SAP-specific flavor naming to identify KVM flavors.
Changes:
- Add a new Prometheus label
hypervisor_familyto thecortex_flavor_running_vmsKPI, derived from flavor name via a regex. - Update the “flavors” dashboard queries and add a new Grafana variable to filter by
hypervisor_family. - Extend unit tests to validate the new label and the KVM flavor-name pattern.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/plutono/provisioning/dashboards/compute/flavors.json | Adds hypervisor_family variable and updates PromQL queries/table columns to filter/group by it. |
| internal/knowledge/kpis/plugins/compute/flavor_running_vms.go | Adds hypervisor_family label and derives it from flavor naming (^[^_]+_k_ => kvm, else vmware). |
| internal/knowledge/kpis/plugins/compute/flavor_running_vms_test.go | Updates KPI test expectations for the new label and adds explicit regex pattern tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| key := flavor + "|" + availabilityZone + "|" + projectID | ||
|
|
There was a problem hiding this comment.
The map key used to collect metrics in this test ignores the new hypervisor_family label. If two metrics ever share the same flavor/zone/project but differ in hypervisor_family, the later one will overwrite the former and the test won’t catch it. Include hypervisor_family in the key (and in expectedMetrics keys) to ensure the test asserts uniqueness across the full label set.
Changes
hypervisor_familylabel to flavor usage kpi