fix(function-autoscaler): use cp environment labels for byoc count - #501
Conversation
Signed-off-by: Bora Oztekin <boztekin@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe BYOC instance-count TimeseriesDb query now labels ChangesBYOC environment labels
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🛡️ CodeQL Analysis🚨 Found 2 issue(s) Severity Breakdown:
📋 Top Issues🔗 View full details in Security tab 🕐 Last updated: 2026-07-28 16:54:53 UTC | Commit: cba508b |
|
🎉 This PR is included in version nvcf-function-autoscaler-v1.18.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
TL;DR
Fix the BYOC/control-plane instance-count query to use the environment label values emitted by
nvcf_function_instances_current:stagingandproduction.Additional Details (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
The autoscaler’s CP instance-count path was mapping
stg -> stageand everything else toprodwhen queryingnvcf_function_instances_current.That label convention is correct for other autoscaler metric queries, but this CP metric uses
environment="staging"andenvironment="production". This caused prod BYOC instance-count lookups to queryenvironment="prod"and miss or undercount matching CP metric series.This change is intentionally scoped to
get_byoc_instance_count; worker metrics, utilization queries, discovery queries, and the existing active-instance helper are unchanged.For the Reviewer
Please focus on
src/control-plane-services/function-autoscaler/crates/server/src/work/mod.rs.The new test directly exercises the BYOC/CP instance-count query path and verifies the query uses
productionforprdandstagingforstg.For QA (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
Verified locally:
cargo fmtcargo test -p rs-autoscaler work::testscargo test -p rs-autoscalerIssues
NO-REF
Checklist
Summary by CodeRabbit