From 9821fae5c69f34be72d24465074d922ce01dd48e Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Sat, 3 Jan 2026 12:36:55 +0800 Subject: [PATCH] Tiny add explanations to realtime token metric labels (#16009) --- python/sglang/srt/metrics/collector.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/python/sglang/srt/metrics/collector.py b/python/sglang/srt/metrics/collector.py index c85fc07b7..95513ede4 100644 --- a/python/sglang/srt/metrics/collector.py +++ b/python/sglang/srt/metrics/collector.py @@ -729,23 +729,35 @@ class SchedulerMetricsCollector: self.realtime_tokens_total = Counter( name="sglang:realtime_tokens_total", - documentation="Total number of tokens processed (updated on each log interval).", + documentation=( + "Total number of tokens processed (updated on each log interval). " + "mode: prefill_compute, prefill_cache, decode." + ), labelnames=list(labels.keys()) + ["mode"], ) self.gpu_execution_seconds_total = Counter( name="sglang:gpu_execution_seconds_total", - documentation="Total time that GPU is busy executing a workload.", + documentation=( + "Total time that GPU is busy executing a workload. " + "Refer to ForwardMode for category labels." + ), labelnames=list(labels.keys()) + ["category"], ) self.dp_cooperation_realtime_tokens_total = Counter( name="sglang:dp_cooperation_realtime_tokens_total", - documentation="Total number of tokens processed with labels about DP cooperation.", + documentation=( + "Total number of tokens processed with labels about DP cooperation. " + "mode: prefill_compute, prefill_cache, decode." + ), labelnames=list(labels.keys()) + ["mode", "num_prefill_ranks"], ) self.dp_cooperation_gpu_execution_seconds_total = Counter( name="sglang:dp_cooperation_gpu_execution_seconds_total", - documentation="Total time that GPU is busy executing a workload with labels about DP cooperation.", + documentation=( + "Total time that GPU is busy executing a workload with labels about DP cooperation. " + "Refer to ForwardMode for category labels." + ), labelnames=list(labels.keys()) + ["category", "num_prefill_ranks"], )