Skip to content

vllm.v1.metrics.prometheus

Functions:

get_prometheus_registry()

Get the appropriate prometheus registry based on multiprocessing configuration.

Returns:

  • Registry ( CollectorRegistry ) –

    A prometheus registry

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.

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.