vllm.v1.metrics.prometheus ¶
Functions:
-
get_prometheus_registry–Get the appropriate prometheus registry based on multiprocessing
-
setup_multiprocess_prometheus–Set up prometheus multiprocessing directory if not already configured.
-
shutdown_prometheus–Shutdown prometheus metrics.
-
unregister_vllm_metrics–Unregister any existing vLLM collectors from the prometheus registry.
get_prometheus_registry() ¶
Get the appropriate prometheus registry based on multiprocessing configuration.
Returns:
-
Registry(CollectorRegistry) –A prometheus registry
Source code in vllm/v1/metrics/prometheus.py
setup_multiprocess_prometheus() ¶
Set up prometheus multiprocessing directory if not already configured.
Source code in vllm/v1/metrics/prometheus.py
shutdown_prometheus() ¶
Shutdown prometheus metrics.
Source code in vllm/v1/metrics/prometheus.py
unregister_vllm_metrics() ¶
Unregister any existing vLLM collectors from the prometheus registry.
This is useful for testing and CI/CD where metrics may be registered multiple times across test runs.
Also, in case of multiprocess, we need to unregister the metrics from the global registry.