Skip to main content

Enable metrics

Enable metrics on an NVIDIA CUDA deployment, for example:
Metrics are opt-in. Disabled metrics do not scan queues or collect LoRA status. Enabled metrics add host-side bookkeeping, not GPU synchronization or collectives.

Metric reference

All diffusion metrics carry role and replica labels. replica is the scheduler endpoint; only each DP replica’s leader publishes, so TP/SP ranks do not multiply request counts. The table lists additional labels. Request counts refer to original scheduler requests, not generated images, denoising steps or distributed shards. status is success or error; is_warmup is true or false. Queue and running gauges include warmup. Stage observations include warmup and count stage invocations, not requests; asynchronous GPU work can complete in a later stage. For synchronized diagnostic timings, use SGLANG_DIFFUSION_SYNC_STAGE_PROFILING=1 separately, accepting its synchronization overhead. LoRA gauges update at startup and after LoRA control operations.

Disaggregated serving

In disaggregated serving, the head (role="server") records the original request lifecycle, including role handoffs and errors. Queue time ends at the first encoder dispatch; intermediate waits remain part of request latency. Workers report their own stage and LoRA metrics, not duplicate completed requests. The generation-batch histogram currently describes monolithic scheduling only. Single-host pool mode exposes all child metrics through the head’s /metrics. A scrape aggregates only processes sharing that host’s metrics directory. For standalone remote roles, pass --enable-metrics to each process and scrape its --host/--port as well as the head. Each role serves a metrics-only HTTP endpoint. Use a separate, empty PROMETHEUS_MULTIPROC_DIR per server launch if you set it yourself; otherwise SGLang creates and owns a temporary directory. Do not share this directory between independent servers or reuse stale files.

Query throughput

Successful, non-warmup request throughput: