feat(capacity): improve FlavorGroupCapacity CRD observability#942
feat(capacity): improve FlavorGroupCapacity CRD observability#942juliusclausnitzer wants to merge 5 commits into
Conversation
📝 WalkthroughWalkthroughThe capacity monitor now exports CRD readiness as a Prometheus gauge. Cortex Nova adds a warning alert for capacity remaining not ready for 10 minutes, and related test helpers are updated for the changed setup. ChangesCapacity readiness observability
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant FlavorGroupCapacity
participant CapacityMonitor
participant Prometheus
participant CortexNovaAlert
FlavorGroupCapacity->>CapacityMonitor: provide Ready condition
CapacityMonitor->>Prometheus: export readiness gauge
Prometheus->>CortexNovaAlert: evaluate readiness for 10m
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Resolve conflicts in: - api/v1alpha1/flavor_group_capacity_types.go: take main's new fields (FreeCapacity, ExclusivelyFreeCapacity, ExclusivelyFreeSlots, RunningInstances, RunningResources) and new kubectl columns; our readyGauge additions are unaffected - internal/scheduling/reservations/capacity/controller.go: take main's reconcileAZ refactor (replaces reconcileOne loop) - internal/scheduling/reservations/capacity/controller_test.go: take main's reconcileAZ-based tests - internal/scheduling/reservations/capacity/metrics.go: take main's new gauges (runningInstances, freeCapacityGiB, exclusivelyFreeCapacityGiB, exclusivelyFreeSlots, committedReservations) plus keep our readyGauge - helm/library/cortex/files/crds/cortex.cloud_flavorgroupcapacities.yaml: regenerated from merged types - docs/reservations/committed-resource-reservations.md: take main's restructured content; our FlavorGroupCapacity readiness section is preserved in Configuration and Observability
Test Coverage ReportTest Coverage 📊: 70.3% |
mblos
left a comment
There was a problem hiding this comment.
Thanks for the PR 👍
- we should update the capacity controller in this pr.. it never writes Ready=False on failure.
- once the controller sets ready=false, the capacity API should return 5xx
| m.exclusivelyFreeSlots.With(groupAZFlavorLabels).Set(float64(crd.Status.ExclusivelyFreeSlots)) | ||
|
|
||
| readyVal := 0.0 | ||
| for _, cond := range crd.Status.Conditions { |
There was a problem hiding this comment.
I suggest to use apimeta.IsStatusConditionTrue(crd.Status.Conditions, v1alpha1.FlavorGroupCapacityConditionReady)
No description provided.