vllm:prefix_cache_queries
Counter for prefix cache queries, in queried tokens.
Summary
In vLLM v0.23.0, under V1 metrics published by PrometheusStatLogger, vllm:prefix_cache_queries counts tokens presented to the first-party prefix-cache lookup, accumulated as a counter. For the kv_cache runtime component in that version, it is a Prometheus counter measured in queried tokens — it counts tokens, not requests or cache blocks. As registered by the PrometheusStatLogger metrics publisher under V1 metrics in v0.23.0, the metric carries the label names model_name and engine. In v0.23.0 it is incremented from SchedulerStats.prefix_cache_stats.queries on each logging update and observes prefix-cache token reuse for the first-party prefix cache, while KV-connector prefix-cache reuse is reported by the separate vllm:external_prefix_cache_* counters. Interpretively, in v0.23.0 it serves as the token denominator for a prefix-cache hit ratio computed over the same labels and the same window. Accordingly, in v0.23.0 you should apply rate or increase over a chosen window alongside prefix_cache_hits, and should not interpret the cumulative total as a rate.
Version history
- In vLLM
v0.23.0,vllm:prefix_cache_queriesis exposed by theV1PrometheusStatLoggeras a Prometheus counter measured in queried tokens, accumulating the tokens presented to the first-party prefix-cache lookup rather than requests or cache blocks. - In that same version it is registered with the label names
model_nameandengine. - Also in
v0.23.0, the counter increments fromSchedulerStats.prefix_cache_stats.querieson each scheduler-stats logging update and observes first-party prefix-cache token reuse, while KV-connector reuse is reported separately by thevllm:external_prefix_cache_*counters. - For interpretation in
v0.23.0, it serves as the token denominator of a same-label, same-window prefix-cache hit ratio, so it should be combined withprefix_cache_hitsusing rate or increase over a chosen window instead of reading the cumulative total as a rate.
Identity
- Prometheus type
- counter
- Labels
- model_nameengine
- Unit
- Not recorded — vLLM registration code has no structured unit field, and units are not inferred from name suffixes
At vLLM v0.23.0
Counts prefix-cache activity in tokens.
counter_prefix_cache_queries = self._counter_cls(
name="vllm:prefix_cache_queries",
documentation=(
"Prefix cache queries, in terms of number of queried tokens."
),
labelnames=labelnames,
)- `queries`: Refers to the number of tokens that were queried.
Lifecycle
| vLLM version | State | Metric name |
|---|---|---|
| v0.29.0 | present | vllm:prefix_cache_queries |
| v0.28.0 | present | vllm:prefix_cache_queries |
| v0.27.1 | present | vllm:prefix_cache_queries |
| v0.27.0 | present | vllm:prefix_cache_queries |
| v0.26.0 | present | vllm:prefix_cache_queries |
| v0.25.1 | present | vllm:prefix_cache_queries |
| v0.25.0 | present | vllm:prefix_cache_queries |
| v0.24.0 | present | vllm:prefix_cache_queries |
| v0.23.0 · selected | present | vllm:prefix_cache_queries |
| v0.22.1 | present | vllm:prefix_cache_queries |
| v0.22.0 | present | vllm:prefix_cache_queries |
| v0.21.0 | present | vllm:prefix_cache_queries |
| v0.20.2 | present | vllm:prefix_cache_queries |
| v0.20.1 | present | vllm:prefix_cache_queries |
| v0.20.0 | present | vllm:prefix_cache_queries |
| v0.19.1 | present | vllm:prefix_cache_queries |
| v0.19.0 | present | vllm:prefix_cache_queries |
| v0.18.1 | present | vllm:prefix_cache_queries |
| v0.18.0 | present | vllm:prefix_cache_queries |
| v0.17.1 | present | vllm:prefix_cache_queries |
| v0.17.0 | present | vllm:prefix_cache_queries |
| v0.16.0 | present | vllm:prefix_cache_queries |
| v0.15.1 | present | vllm:prefix_cache_queries |
| v0.15.0 | present | vllm:prefix_cache_queries |
| v0.14.1 | present | vllm:prefix_cache_queries |
| v0.14.0 | present | vllm:prefix_cache_queries |
| v0.13.0 | present | vllm:prefix_cache_queries |
| v0.12.0 | present | vllm:prefix_cache_queries |
| v0.11.2 | present | vllm:prefix_cache_queries |
| v0.11.1 | present | vllm:prefix_cache_queries |
| v0.11.0 | present | vllm:prefix_cache_queries |
| v0.10.2 | present | vllm:prefix_cache_queries |
| v0.10.1.1 | present | vllm:prefix_cache_queries |
| v0.10.1 | present | vllm:prefix_cache_queries |
| v0.10.0 | present | vllm:prefix_cache_queries |
| v0.9.2 | present | vllm:prefix_cache_queries |
| v0.9.1 | present | vllm:gpu_prefix_cache_queries |
| v0.9.0.1 | present | vllm:gpu_prefix_cache_queries |
| v0.9.0 | present | vllm:gpu_prefix_cache_queries |
| v0.8.5.post1 | present | vllm:gpu_prefix_cache_queries |
| v0.8.5 | present | vllm:gpu_prefix_cache_queries |
| v0.8.4 | present | vllm:gpu_prefix_cache_queries |
| v0.8.3 | present | vllm:gpu_prefix_cache_queries |
| v0.8.2 | present | vllm:gpu_prefix_cache_queries |
| v0.8.1 | present | vllm:gpu_prefix_cache_queries |
| v0.8.0 | present | vllm:gpu_prefix_cache_queries |
| v0.7.3 | present | vllm:gpu_prefix_cache_queries |
| v0.7.2 | absent | vllm:prefix_cache_queries |
| v0.7.1 | absent | vllm:prefix_cache_queries |
| v0.7.0 | absent | vllm:prefix_cache_queries |
Semantic coverage
Metric knowledge (7)
Related Use Cases (3)
Availability
vllm:prefix_cache_queries is registered as a Prometheus counter in vLLM v0.23.0.