-
Notifications
You must be signed in to change notification settings - Fork 458
[Feature] Adding raw metrics name conversion in metrics #1293
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
Merged
Jeffwan
merged 19 commits into
vllm-project:main
from
happyandslow:lexu/engine-metric-conversion
Jul 25, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c98ab6a
adding raw metrics name conversion in metrics
42a5d75
adding policy least gpu/util
9ad913e
enhance log for debugging purposes
b164150
enhance log for debugging purposes
4798279
nhance log for debugging purposes v0.3.0-metrics-3
080d3e9
enhance logs
db273ed
Update pkg/metrics/metrics.go
happyandslow 6f05475
Update pkg/metrics/types.go
happyandslow 1b87c39
update format
3c294c6
fix missing modelname/pod
7fea5d7
change busy time metrics type
99dff78
addressing comments
41a0ee8
renaming
c280e73
formatting
47a5284
renaming
4b58504
adding license
16ad7ee
update comments
61fd8fb
splitting policy branch
14fb400
addressing comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright 2025 The Aibrix Team. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package cache | ||
|
||
import ( | ||
"fmt" | ||
"strconv" | ||
|
||
"k8s.io/klog/v2" | ||
) | ||
|
||
func getPodMetricPort(pod *Pod) int { | ||
if pod == nil || pod.Labels == nil { | ||
return defaultMetricPort | ||
} | ||
if v, ok := pod.Labels[MetricPortLabel]; ok && v != "" { | ||
if p, err := strconv.Atoi(v); err == nil { | ||
return p | ||
} else { | ||
klog.Warningf("Invalid value for label %s on pod %s/%s: %q. Using default port %d.", MetricPortLabel, pod.Namespace, pod.Name, v, defaultMetricPort) | ||
} | ||
} | ||
return defaultMetricPort | ||
} | ||
|
||
func getPodLabel(pod *Pod, labelName string) (string, error) { | ||
labelTarget, ok := pod.Labels[labelName] | ||
if !ok { | ||
klog.V(4).Infof("No label %v name for pod %v, default to %v", labelName, pod.Name, defaultEngineLabelValue) | ||
err := fmt.Errorf("error executing query: no label %v found for pod %v", labelName, pod.Name) | ||
return "", err | ||
} | ||
return labelTarget, nil | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.