From 38b864d81d8bc42d6d7d892a0931f4c4c2517735 Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Fri, 29 May 2026 15:56:44 -0400 Subject: [PATCH] [Metrics] Exclude KV transfer tokens from iteration_tokens_total (#43346) Signed-off-by: Tyler Michael Smith Co-authored-by: Claude Opus 4.6 (1M context) --- vllm/v1/metrics/loggers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/v1/metrics/loggers.py b/vllm/v1/metrics/loggers.py index 6855efd9f5..0052a35366 100644 --- a/vllm/v1/metrics/loggers.py +++ b/vllm/v1/metrics/loggers.py @@ -1161,7 +1161,8 @@ class PrometheusStatLogger(AggregateStatLoggerBase): iteration_stats.num_generation_tokens ) self.histogram_iteration_tokens[engine_idx].observe( - iteration_stats.num_prompt_tokens + iteration_stats.num_generation_tokens + iteration_stats.prompt_token_stats.computed + + iteration_stats.num_generation_tokens ) for max_gen_tokens in iteration_stats.max_num_generation_tokens_iter: