R.2

Metrics

These are the Prometheus series this manual reads, what each one measures, and the question each one answers in production.

--enable-metrics turns on /metrics. Without the flag, the endpoint does not exist, and the default is off. Our default server exported 81 metric families with the prefix sglang: (the metrics capture). Section 5.2 explains which ones to alert on. This table keeps the ones the manual uses.

Latency

SeriesTypeMeasuresThe question it answers
sglang:time_to_first_token_secondshistogramthe time from arrival to the first output tokenare users waiting before they see anything
sglang:inter_token_latency_secondshistogramthe time between two output tokensdoes the stream stutter
sglang:request_time_per_output_token_secondshistogramper request, the decode time divided by the output tokens after the firstis decode slow for each user
sglang:e2e_request_latency_secondshistogramthe time from arrival to the last tokenhow long does a full answer take
sglang:queue_time_secondshistogramthe time a request waits before its first prefillis the scheduler holding requests back

Load and memory

SeriesTypeMeasuresThe question it answers
sglang:num_running_reqsgaugerequests in the running batchhow much work is on the GPU now
sglang:num_queue_reqsgaugerequests in the waiting queueis admission the bottleneck
sglang:token_usagegaugethe fraction of pool slots in usehow close the pool is to full
sglang:num_retracted_reqsgaugerequests the scheduler moved back to the queue in the last log intervaldid the admission forecast fail just now
sglang:num_retracted_requests_totalcounterrequests the scheduler moved back to the queue since starthow often does the admission forecast fail
sglang:max_total_num_tokensgaugethe size of the KV pool in tokenswhat did startup sizing decide
sglang:kv_cache_memory_usage_gbgaugememory used by the KV poolshow much memory the cache holds
sglang:gen_throughputgaugeoutput tokens per second in the last intervalis the server producing tokens
sglang:scheduler_idle_seconds_totalcountertime with no runnable or queued workis the server underused

Cache and tokens

SeriesTypeMeasuresThe question it answers
sglang:cache_hit_rategaugethe prefix cache hit rateare prompts reusing the cache
sglang:cached_tokens_totalcountercached prompt tokens, by source: device, host, or storagewhich cache tier served the hits
sglang:prompt_tokens_totalcounterprefill tokens processedhow much prompt work arrived
sglang:uncached_prompt_tokens_histogramhistogramprompt tokens that needed computehow much prompt work was new
sglang:generation_tokens_totalcounteroutput tokens producedhow much decode work was done
sglang:num_requests_totalcounterfinished requestshow many requests were served
sglang:num_paused_reqsgaugerequests paused for a weight updateis an RL trainer pausing the server

What our runs recorded

After the shared-prefix benchmark, the default server reported sglang:cache_hit_rate 0.94. The server with --disable-radix-cache reported 0.0 for the same benchmark. The gauge covers a recent window.

The counters cover the whole life of each server, and the two servers ran different sets of benchmarks before the scrape. The default server counted 286,134 prompt tokens, 286,102 streamed plus 32. Of those, 182,079 came from the cache, a lifetime ratio of 0.64. Each counter appears once per label set, so sum the rows before you divide.

SGLang 0.5.22 · baa9bef · 2026-10-13 · Edition 2026.10