vllm.v1.metrics.prometheus
 module-attribute  ¶
 _prometheus_multiproc_dir: Optional[TemporaryDirectory] = (
    None
)
 
  Get the appropriate prometheus registry based on multiprocessing configuration.
Returns:
| Name | Type | Description | 
|---|---|---|
| Registry | A prometheus registry | 
Source code in vllm/v1/metrics/prometheus.py
  
  Set up prometheus multiprocessing directory if not already configured.
Source code in vllm/v1/metrics/prometheus.py
  
  Shutdown prometheus metrics.
Source code in vllm/v1/metrics/prometheus.py
  
  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.