Skip to content

Commit 2c56f9b

Browse files
committed
fix
Signed-off-by: Kuromesi <[email protected]>
1 parent 67d0654 commit 2c56f9b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/epp/backend/vllm/metrics.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ const (
4949
KvCacheMaxTokenCapacityMetricName = "vllm:gpu_cache_max_token_capacity"
5050
)
5151

52-
type PodMetricsClientImpl struct{}
52+
type PodMetricsClientImpl struct {
53+
scrapePort int32
54+
scrapePath string
55+
}
56+
57+
func (p *PodMetricsClientImpl) UpdateScrapeOptions(port int32, path string) {
58+
p.scrapePort = port
59+
p.scrapePath = path
60+
}
5361

5462
// FetchMetrics fetches metrics from a given pod.
5563
func (p *PodMetricsClientImpl) FetchMetrics(
@@ -62,7 +70,7 @@ func (p *PodMetricsClientImpl) FetchMetrics(
6270

6371
// Currently the metrics endpoint is hard-coded, which works with vLLM.
6472
// TODO(https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/16): Consume this from InferencePool config.
65-
url := existing.Address + ":" + strconv.Itoa(int(port)) + "/metrics"
73+
url := "http://" + existing.Address + ":" + strconv.Itoa(int(port)) + "/metrics"
6674

6775
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
6876
if err != nil {

0 commit comments

Comments
 (0)