An inference service needs the same reliability discipline as any production system, with metrics that fit how LLMs behave. This lesson turns time to first token and inter-token latency into service level indicators and objectives, shows the PromQL to measure them from engine histograms, designs burn-rate alerts, and lays out the observability stack: engine, GPU and gateway metrics, traces with the GenAI semantic conventions, and logs that do not leak prompts.
- Define SLIs and SLOs for TTFT, inter-token latency, availability and correctness
- Compute SLI ratios and percentiles from Prometheus histograms
- Write multi-window burn-rate alerts for an inference SLO
- Assemble metrics from the engine, DCGM and the gateway into one dashboard
- Trace requests with GenAI attributes while protecting prompt data
From latency metrics to SLOs
A service level indicator (SLI) is a ratio of good events to all events; a service level objective (SLO) is the target for that ratio over a window; the error budget is what is left over. For LLM inference, good SLIs reflect what users feel.
| SLI | Good event | Example SLO |
|---|---|---|
| Responsiveness | TTFT under 0.5 s | 99% of requests over 28 days |
| Streaming smoothness | Inter-token gaps under 50 ms | 99% of gaps over 28 days |
| Availability | Request completed without a 5xx or timeout | 99.9% over 28 days |
| Quality (sampled) | Passes an automated evaluation check | 95% of sampled requests over 7 days |
Pick thresholds that sit on real histogram bucket boundaries so the ratio is exact; vLLM's default TTFT histogram has a 0.5 s bucket and its inter-token latency histogram a 50 ms one. Measure the SLO at the gateway or client where possible, and use engine histograms to explain breaches.
Keep the list short. Two latency SLOs and one availability SLO per model endpoint is plenty to start; more objectives mean more alerts and more arguments about which one matters. Revisit thresholds after a month of data: if you never come close to burning the budget, the target may be too loose to protect users; if you burn it every week, either the system or the target needs to change.
Measuring with PromQL
sum(rate(vllm:time_to_first_token_seconds_bucket{model_name="chat", le="0.5"}[5m]))
/
sum(rate(vllm:time_to_first_token_seconds_count{model_name="chat"}[5m]))histogram_quantile(0.95,
sum by (le) (rate(vllm:time_to_first_token_seconds_bucket{model_name="chat"}[5m])))
histogram_quantile(0.99,
sum by (le) (rate(vllm:inter_token_latency_seconds_bucket{model_name="chat"}[5m])))Record these as recording rules (for example model:ttft_good:ratio_rate5m) so alerts and dashboards read one cheap series. Engine histograms only see requests that reached the engine; requests rejected by the gateway or timed out in front of it must come from gateway metrics, which is another reason to put the availability SLI there.
Alerting on burn rate
Alert on how fast you are spending the error budget, not on single bad minutes. With a 99% TTFT SLO the budget is 1% slow requests. A burn rate of 14.4 means spending the budget 14.4 times faster than sustainable, which would exhaust 2% of a 30-day budget in an hour. The standard pattern pages on a fast burn confirmed over a short and a long window, and opens a ticket for a slow burn.
Two windows guard against two failure modes. The long window (one hour) proves the problem is sustained, so a few slow requests during a deploy do not wake anyone. The short window (five minutes) proves it is still happening, so the alert resolves quickly once the cause is fixed instead of firing for an hour afterwards. A second, slower tier, for example a burn rate of 6 over six hours, catches gradual degradation such as a growing prompt length that slowly erodes TTFT, and usually opens a ticket rather than paging.
groups:
- name: inference-slo
rules:
- alert: ChatTTFTBudgetFastBurn
expr: |
(1 - model:ttft_good:ratio_rate1h{model_name="chat"}) > (14.4 * 0.01)
and
(1 - model:ttft_good:ratio_rate5m{model_name="chat"}) > (14.4 * 0.01)
labels:
severity: page
annotations:
summary: "chat TTFT error budget burning 14x too fast"Pair every SLO alert with a runbook link that starts with the four diagnostic panels: TTFT and ITL percentiles, waiting versus running requests, KV-cache usage, and throughput. They distinguish queueing, prefill, decode and memory problems in a minute.
The observability stack
- Engine metrics (
vllm:*or equivalents): queue, running, cache usage, TTFT, inter-token latency, tokens, preemptions. - GPU metrics from DCGM: memory used, Tensor Core and memory activity, power, NVLink throughput and error counters.
- Gateway metrics: request rate, status codes, rejections (429s), per-tenant token usage, upstream latency.
- Traces with OpenTelemetry: one span per request with child spans for retrieval, tool calls and model calls, using GenAI semantic-convention attributes such as
gen_ai.request.modelandgen_ai.usage.input_tokensandgen_ai.usage.output_tokens. - Logs: request IDs, model, token counts, latency and finish reason; not raw prompts and outputs unless policy allows, and then redacted and access-controlled.
Put cost on the same dashboard: tokens per second times your cost per million tokens gives spend in near real time, and per-tenant token counters make chargeback and abuse detection possible. The Grafana lesson in the open-source track walks through building exactly this dashboard.