Repository navigation
feat: add metrics for capacity recommendation provider - #1908
Merged
Matthew Christopher (matthchr) merged 5 commits intoSep 15, 2026
Merged
Matthew Christopher (matthchr) merged 5 commits into
Matthew Christopher (matthchr) merged 5 commits into
Conversation
Copilot started reviewing on behalf of
Matthew Christopher (matthchr)
September 14, 2026 18:18
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
Adds Prometheus metrics for capacity recommendation API requests, latency, results, and cache hits.
Changes:
- Instruments SKU Mix Placement API calls.
- Records request outcomes, durations, and cache hits.
- Adds shared metric labels and unit tests.
File summaries
| File | Description |
|---|---|
pkg/providers/capacityrecommendation/metrics.go |
Defines capacity recommendation metrics. |
pkg/providers/capacityrecommendation/capacity_recommendation.go |
Integrates API and cache-hit instrumentation. |
pkg/providers/capacityrecommendation/capacity_recommendation_test.go |
Tests emitted metrics. |
pkg/metrics/constants.go |
Adds shared metric label constants. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alex Leites (tallaxes)
previously approved these changes
Sep 14, 2026
Bevan Arps (theunrepentantgeek)
previously approved these changes
Sep 14, 2026
Matthew Christopher (matthchr)
dismissed stale reviews from Bevan Arps (theunrepentantgeek) and Alex Leites (tallaxes)
via
September 14, 2026 23:42
05be477
Copilot started reviewing on behalf of
Matthew Christopher (matthchr)
September 14, 2026 23:42
View session
Alex Leites (tallaxes)
previously approved these changes
Sep 14, 2026
Copilot started reviewing on behalf of
Matthew Christopher (matthchr)
September 14, 2026 23:58
View session
Alex Leites (tallaxes)
previously approved these changes
Sep 14, 2026
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
A moderate performance issue remains in the cache-hit metric label path.
Review details
Suppressed comments (1)
pkg/providers/capacityrecommendation/metrics.go:96
- Medium · Performance — On every cache lookup, including hits, this rebuilds the complete SDK request (allocating VM-size and zone pointer slices) solely to derive the metric labels.
GetRecommendationsis called once per recommendation group and the cache-hit path is intended to avoid this work; derive the same labels directly fromRankingInput(ideally via a dedicated input-label helper) instead of callingtoSKUMixPlacementRequesthere.
labels := requestMetricLabels(toSKUMixPlacementRequest(input))
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Copilot started reviewing on behalf of
Matthew Christopher (matthchr)
September 15, 2026 00:17
View session
Alex Leites (tallaxes)
approved these changes
Sep 15, 2026
Matthew Christopher (matthchr)
deleted the
matthchr/capacity-rec-metrics
branch
September 15, 2026 00:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
How was this change tested?
Does this change impact docs?
Release Note