Skip to content

vllm.v1.metrics.ray_wrappers

Classes:

RayCounterWrapper

Bases: RayPrometheusMetric

Wraps around ray.util.metrics.Counter to provide same API as prometheus_client.Counter

RayGaugeWrapper

Bases: RayPrometheusMetric

Wraps around ray.util.metrics.Gauge to provide same API as prometheus_client.Gauge

RayHistogramWrapper

Bases: RayPrometheusMetric

Wraps around ray.util.metrics.Histogram to provide same API as prometheus_client.Histogram

RayKVConnectorProm

Bases: KVConnectorProm

RayKVConnectorProm is used by RayMetrics to log Ray metrics. Provides the same metrics as KV connectors but uses Ray's util.metrics library.

RayPerfMetricsProm

Bases: PerfMetricsProm

RayPerfMetricsProm is used by RayMetrics to log Ray metrics. Provides the same MFU metrics as PerfMetricsProm uses Ray's util.metrics library.

RayPrometheusMetric

_get_sanitized_opentelemetry_name(name) staticmethod

For compatibility with Ray + OpenTelemetry, the metric name must be sanitized. In particular, this replaces disallowed character (e.g., ':') with '_' in the metric name. Allowed characters: a-z, A-Z, 0-9, _

ruff: noqa: E501

Ref: https://github.com/open-telemetry/opentelemetry-cpp/blob/main/sdk/src/metrics/instrument_metadata_validator.cc#L22-L23 Ref: https://github.com/ray-project/ray/blob/master/src/ray/stats/metric.cc#L107

RayPrometheusStatLogger

Bases: PrometheusStatLogger

RayPrometheusStatLogger uses Ray metrics instead.

RaySpecDecodingProm

Bases: SpecDecodingProm

RaySpecDecodingProm is used by RayMetrics to log to Ray metrics. Provides the same metrics as SpecDecodingProm but uses Ray's util.metrics library.

_get_replica_id()

Get the current Ray Serve replica ID, or None if not in a Serve context.