vLLM prometheus.py multiprocess-registry source and its stale-directory warning
repo
Fields
id
sources/ops-vllm-prometheus-multiprocPublisher
vLLM project
Kind
repo
Published
main branch as of 2026-10-04
Accessed
2026-10-04
notes
setup_multiprocess_prometheus() logs at WARNING level when PROMETHEUS_MULTIPROC_DIR is already present in the environment: 'Found PROMETHEUS_MULTIPROC_DIR was set by user. This directory must be wiped between vLLM runs or you will find inaccurate metrics. Unset the variable and vLLM will properly handle cleanup.' When the variable is absent vLLM creates its own TemporaryDirectory and assigns it; shutdown_prometheus() then calls mark_process_dead against that directory. The stale-series problem therefore only arises when the operator supplies the directory, or when a process is killed without running cleanup.
Notes
setup_multiprocess_prometheus() logs at WARNING level when PROMETHEUS_MULTIPROC_DIR is already present in the environment: 'Found PROMETHEUS_MULTIPROC_DIR was set by user. This directory must be wiped between vLLM runs or you will find inaccurate metrics. Unset the variable and vLLM will properly handle cleanup.' When the variable is absent vLLM creates its own TemporaryDirectory and assigns it; shutdown_prometheus() then calls mark_process_dead against that directory. The stale-series problem therefore only arises when the operator supplies the directory, or when a process is killed without running cleanup.
Cross-references
This record references no other records.