1
1
from vllm .logger import init_logger
2
- from prometheus_client import Counter , Gauge , Histogram , REGISTRY , disable_created_metrics
2
+ from prometheus_client import Counter , Gauge , Histogram , Info , REGISTRY , disable_created_metrics
3
3
4
4
import time
5
5
import numpy as np
@@ -23,6 +23,10 @@ def __init__(self, labelnames: List[str]):
23
23
if hasattr (collector , "_name" ) and "vllm" in collector ._name :
24
24
REGISTRY .unregister (collector )
25
25
26
+ self .info_cache_config = Info (
27
+ name = 'vllm:cache_config' ,
28
+ documentation = 'information of cache_config' )
29
+
26
30
# System stats
27
31
self .gauge_scheduler_running = Gauge (
28
32
name = "vllm:num_requests_running" ,
@@ -128,6 +132,10 @@ def __init__(self, local_interval: float, labels: Dict[str, str]) -> None:
128
132
self .labels = labels
129
133
self .metrics = Metrics (labelnames = list (labels .keys ()))
130
134
135
+ def info (self , type : str , obj : object ) -> None :
136
+ if type == "cache_config" :
137
+ self .metrics .info_cache_config .info (obj .metrics_info ())
138
+
131
139
def _get_throughput (self , tracked_stats : List [int ], now : float ) -> float :
132
140
return float (np .sum (tracked_stats ) / (now - self .last_local_log ))
133
141
0 commit comments