Skip to content

vllm_omni.metrics.stat_logger

OmniPrometheusStatLogger — wrap upstream PrometheusStatLogger.

Rewrites the upstream engine single-label scheme into a stage + replica two-label scheme so the ~37 vllm:* metric families gain per-(stage, replica) visibility for multi-replica deployments.

Contents: - _ENGINE_INDEX_MAP: process-wide engine_idx → (stage_name, replica_id) lookup, populated by OmniPrometheusStatLogger.__init__. - _RelabelMixin: rewrites labelnames at family creation and translates .labels() calls; applied via _RelabelGauge / _RelabelCounter / _RelabelHistogram. - _OmniPerfMetricsProm / _OmniSpecDecodingProm / _OmniKVConnectorProm: helper-class wraps so the upstream sub-collectors construct their internal families through the relabel mixin too. - OmniPrometheusStatLogger: the subclass that wires everything together and rewrites per_engine_labelvalues from 2-tuple to 3-tuple at setter time.

OmniPrometheusStatLogger

Bases: PrometheusStatLogger

Wrap upstream PrometheusStatLogger to expose per-(stage, replica) labels.

Replaces the upstream single engine label with two labels stage and replica so the ~37 vllm:* metric families gain per-replica visibility for multi-replica deployments.

The orchestrator builds stage_replica_map from the static stage_pools config; flat engine_idx values map 1:1 to (stage_name, replica_id) tuples. Dynamic add/remove of replicas at runtime is intentionally not supported — the map is built once at construction and never mutated afterward.

per_engine_labelvalues property writable

per_engine_labelvalues: dict[int, list[object]]

stage_replica_map property

stage_replica_map: dict[int, tuple[str, str]]