<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Prometheus on vishctl</title><link>https://vishctl.dev/tags/prometheus/</link><description>Recent content in Prometheus on vishctl</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 16 Nov 2026 09:00:00 +0800</lastBuildDate><atom:link href="https://vishctl.dev/tags/prometheus/index.xml" rel="self" type="application/rss+xml"/><item><title>Monitoring vLLM in Production: Six Panels and Four Alerts</title><link>https://vishctl.dev/posts/monitoring-vllm-prometheus-dashboard-alerts/</link><pubDate>Mon, 16 Nov 2026 09:00:00 +0800</pubDate><guid>https://vishctl.dev/posts/monitoring-vllm-prometheus-dashboard-alerts/</guid><category>observability</category><category>prometheus</category><category>vllm</category><category>inference</category><category>kubernetes</category><category>ai-infra</category><description>A simple, diagram-first guide to monitoring a vLLM deployment with Prometheus: why GPU dashboards mislead, the six panels worth building, four alerts that catch real problems, and a triage table for reading them together.</description><content:encoded><![CDATA[<p>Most teams start monitoring LLM serving with a GPU dashboard: utilization, memory, temperature. It looks reassuring. It also misses almost every problem users actually feel.</p>
<p>A GPU that is 98% busy might be serving everyone happily, or it might have 40 requests stuck in a queue. The hardware graphs look the same in both cases.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">GPU dashboard   = is the hardware busy?
</span></span><span class="line"><span class="cl">Model dashboard = are users waiting?
</span></span></code></pre></div><figure class="mermaid-figure">
  <div class="mermaid">flowchart TD
    subgraph HW["GPU dashboard"]
        direction LR
        H1["Utilization<br/>98%"] h1@--> H2["Memory<br/>72 of 80 GB"]
        H2 h2@--> H3["Looks fine"]
    end

    subgraph MODEL["Model dashboard"]
        direction LR
        M1["25 requests<br/>waiting"] m1@--> M2["P95 TTFT<br/>6 seconds"]
        M2 m2@--> M3["Users are<br/>waiting"]
    end

    HW ~~~ MODEL
    h1@{ animate: true }
    h2@{ animate: true }
    m1@{ animate: true }
    m2@{ animate: true }

    classDef idle fill:#101e27,stroke:#324950,color:#8aa0a8;
    classDef gpu fill:#173f59,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    classDef tree fill:#281d48,stroke:#a78bfa,color:#f1edff,stroke-width:2px;
    classDef warn fill:#302410,stroke:#fbbf24,color:#fff3cf,stroke-width:2px;
    class H1,H2 idle;
    class H3 gpu;
    class M1,M2 tree;
    class M3 warn;</div>
  <figcaption>Top: the hardware view of an overloaded server looks healthy. Bottom: the model server&#39;s own metrics show the queue and the slow first tokens.</figcaption>
</figure>

<p>This post is the production follow-up to my <a href="https://vishctl.dev/posts/llm-inference-metrics-ttft-tpot-throughput-goodput/">inference metrics guide</a>. That one explains what TTFT and TPOT mean. This one shows which graphs to build, which alerts to set, and how to read them together at 2 a.m.</p>
<h2 id="where-each-metric-comes-from">Where each metric comes from</h2>
<p>vLLM publishes its own metrics at <code>/metrics</code> in Prometheus format. Several of them time one specific stage of a request:</p>
<figure class="mermaid-figure">
  <div class="mermaid">flowchart LR
    A["Request<br/>arrives"] s1@--> Q["Queue<br/>queue_time"]
    Q s2@--> P["Prefill<br/>prefill_time"]
    P s3@--> D["Decode<br/>decode_time"]
    D s4@--> E["Done<br/>e2e_latency"]

    s1@{ animate: true }
    s2@{ animate: true }
    s3@{ animate: true }
    s4@{ animate: true }

    classDef input fill:#13264a,stroke:#38bdf8,color:#e6f6ff,stroke-width:2px;
    classDef warn fill:#302410,stroke:#fbbf24,color:#fff3cf,stroke-width:2px;
    classDef tree fill:#281d48,stroke:#a78bfa,color:#f1edff,stroke-width:2px;
    classDef gpu fill:#173f59,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    class A input;
    class Q warn;
    class P tree;
    class D,E gpu;</div>
  <figcaption>One request passes through three stages. vLLM times each one separately (request_queue_time_seconds, request_prefill_time_seconds, request_decode_time_seconds) plus the whole trip (e2e_request_latency_seconds).</figcaption>
</figure>

<p>Every name below carries the <code>vllm:</code> prefix. There are three kinds:</p>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Kind</th>
            <th scope="col">What it is</th>
            <th scope="col">Examples</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Gauge</td>
            <td>A value right now</td>
            <td><code>num_requests_running</code>, <code>num_requests_waiting</code>, <code>kv_cache_usage_perc</code></td>
        </tr>
        <tr>
            <td>Counter</td>
            <td>A total that only goes up</td>
            <td><code>prompt_tokens</code>, <code>generation_tokens</code>, <code>prefix_cache_hits</code></td>
        </tr>
        <tr>
            <td>Histogram</td>
            <td>A spread of timings</td>
            <td><code>time_to_first_token_seconds</code>, <code>inter_token_latency_seconds</code></td>
        </tr>
    </tbody>
  </table>
</div>
<p>Two details save a lot of confusion later:</p>
<ul>
<li><strong>Counters get a <code>_total</code> suffix in Prometheus.</strong> The counter <code>vllm:generation_tokens</code> is queried as <code>vllm:generation_tokens_total</code>.</li>
<li><strong>Histograms get a <code>_bucket</code> suffix.</strong> Percentiles are calculated from <code>vllm:time_to_first_token_seconds_bucket</code>.</li>
</ul>
<p>Metric names change between vLLM releases. Before copying any query, check what your version exposes:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -s http://localhost:8000/metrics <span class="p">|</span> grep <span class="s1">&#39;^# HELP vllm&#39;</span> <span class="p">|</span> cut -d<span class="s1">&#39; &#39;</span> -f3
</span></span></code></pre></div><h2 id="the-six-panels">The six panels</h2>
<p>A useful dashboard answers four questions: how much traffic, how slow, how full, and how well the cache works. Six panels cover them.</p>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Panel</th>
            <th scope="col">Question it answers</th>
            <th scope="col">Healthy looks like</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1. Traffic</td>
            <td>How much work is arriving?</td>
            <td>Follows your usual daily shape</td>
        </tr>
        <tr>
            <td>2. Queue</td>
            <td>Is anyone waiting for a slot?</td>
            <td>Flat at zero</td>
        </tr>
        <tr>
            <td>3. TTFT</td>
            <td>How long until the first token?</td>
            <td>P95 inside your target</td>
        </tr>
        <tr>
            <td>4. Token speed</td>
            <td>How smooth is the stream?</td>
            <td>Steady, no spikes</td>
        </tr>
        <tr>
            <td>5. KV cache</td>
            <td>How full is GPU memory?</td>
            <td>Below about 90%</td>
        </tr>
        <tr>
            <td>6. Prefix cache</td>
            <td>Is repeated context being reused?</td>
            <td>Stable hit rate</td>
        </tr>
    </tbody>
  </table>
</div>
<h3 id="1-traffic">1. Traffic</h3>
<p>Output tokens per second is the best single measure of how hard the server is working:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sum(rate(vllm:generation_tokens_total[5m]))
</span></span></code></pre></div><p>Add input tokens as a second line. A jump in input with flat output usually means someone started sending much longer prompts.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sum(rate(vllm:prompt_tokens_total[5m]))
</span></span></code></pre></div><h3 id="2-queue">2. Queue</h3>
<p>This is the most important panel on the page. Plot running and waiting together:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sum(vllm:num_requests_running)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sum(vllm:num_requests_waiting)
</span></span></code></pre></div><p>Running goes up and down with traffic. Waiting should sit at zero. <strong>Any sustained value above zero means you are out of capacity.</strong></p>
<h3 id="3-time-to-first-token">3. Time to first token</h3>
<p>Show P50, P95, and P99 as three lines:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">histogram_quantile(0.95, sum by (le) (rate(vllm:time_to_first_token_seconds_bucket[5m])))
</span></span></code></pre></div><p>Change <code>0.95</code> to <code>0.50</code> and <code>0.99</code> for the other two. When P50 is calm but P99 climbs, a few requests are queueing or carrying very long prompts.</p>
<h3 id="4-token-speed">4. Token speed</h3>
<p>Inter-token latency shows how smoothly answers stream:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">histogram_quantile(0.95, sum by (le) (rate(vllm:inter_token_latency_seconds_bucket[5m])))
</span></span></code></pre></div><p>This line rises gently as the batch gets bigger. A sudden step up usually means a noisy neighbor on a <a href="https://vishctl.dev/posts/kubernetes-gpu-sharing-time-slicing-mps-mig/">shared GPU</a> or a batch that grew too large.</p>
<h3 id="5-kv-cache-usage">5. KV cache usage</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">max by (pod) (vllm:kv_cache_usage_perc)
</span></span></code></pre></div><p>The value runs from 0 to 1. Near 1.0, the server has no memory left for new context, so requests wait or get preempted. The <a href="https://vishctl.dev/posts/llm-gpu-memory-sizing-weights-kv-cache/">GPU memory sizing guide</a> explains what fills it.</p>
<h3 id="6-prefix-cache-hit-rate">6. Prefix cache hit rate</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sum(rate(vllm:prefix_cache_hits_total[5m]))
</span></span><span class="line"><span class="cl">  /
</span></span><span class="line"><span class="cl">sum(rate(vllm:prefix_cache_queries_total[5m]))
</span></span></code></pre></div><p>This is the share of prompt tokens that were served from cache instead of being recomputed. A high number means cheap, fast prefills. A sudden drop usually means a prompt template changed, or requests started landing on replicas that have not seen their prefix.</p>
<h3 id="bonus-one-gpu-row">Bonus: one GPU row</h3>
<p>The hardware view still matters for hardware problems. If you run NVIDIA&rsquo;s DCGM exporter, three graphs are enough:</p>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Graph</th>
            <th scope="col">Metric</th>
            <th scope="col">Catches</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>GPU memory used</td>
            <td><code>DCGM_FI_DEV_FB_USED</code></td>
            <td>A neighbor eating shared memory</td>
        </tr>
        <tr>
            <td>Temperature</td>
            <td><code>DCGM_FI_DEV_GPU_TEMP</code></td>
            <td>Cooling problems and throttling</td>
        </tr>
        <tr>
            <td>Utilization</td>
            <td><code>DCGM_FI_DEV_GPU_UTIL</code></td>
            <td>A GPU that is idle when it should not be</td>
        </tr>
    </tbody>
  </table>
</div>
<p>Use utilization to spot an idle GPU. Do not use it to judge load.</p>
<h2 id="reading-the-panels-together">Reading the panels together</h2>
<p>One panel rarely tells the story. The combination does. Here is one incident, step by step:</p>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Time</th>
            <th scope="col">What the panels show</th>
            <th scope="col">What it means</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>14:00</td>
            <td>Traffic normal, queue 0, P95 TTFT 300 ms</td>
            <td>Healthy</td>
        </tr>
        <tr>
            <td>14:05</td>
            <td>Input tokens triple, output tokens flat</td>
            <td>Someone is sending much longer prompts</td>
        </tr>
        <tr>
            <td>14:08</td>
            <td>KV cache at 0.97, queue climbs to 12</td>
            <td>Memory is full, new requests cannot start</td>
        </tr>
        <tr>
            <td>14:10</td>
            <td>P95 TTFT 7 s, token speed unchanged</td>
            <td>Users wait to start, but streams are still smooth</td>
        </tr>
    </tbody>
  </table>
</div>
<p>The fix here is not &ldquo;add GPUs because TTFT is high&rdquo;. It is &ldquo;find the client sending huge prompts&rdquo;, or cap prompt length. The panels tell you that because TTFT, the queue, and the KV cache moved together while token speed stayed flat.</p>
<h3 id="a-triage-table">A triage table</h3>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Queue</th>
            <th scope="col">TTFT</th>
            <th scope="col">Token speed</th>
            <th scope="col">KV cache</th>
            <th scope="col">Most likely cause</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Growing</td>
            <td>High</td>
            <td>Normal</td>
            <td>Normal</td>
            <td>Not enough replicas for the request rate</td>
        </tr>
        <tr>
            <td>Growing</td>
            <td>High</td>
            <td>Normal</td>
            <td>Near full</td>
            <td>Long prompts filling memory</td>
        </tr>
        <tr>
            <td>Zero</td>
            <td>High</td>
            <td>Normal</td>
            <td>Normal</td>
            <td>Long prompts with no cache hits</td>
        </tr>
        <tr>
            <td>Zero</td>
            <td>Normal</td>
            <td>Slow</td>
            <td>Normal</td>
            <td>Batch too large, or a noisy neighbor</td>
        </tr>
        <tr>
            <td>Zero</td>
            <td>Normal</td>
            <td>Normal</td>
            <td>Normal</td>
            <td>Healthy. Look at the client or network</td>
        </tr>
    </tbody>
  </table>
</div>
<figure class="mermaid-figure">
  <div class="mermaid">flowchart TD
    Q1["TTFT is high"] t1@--> Q2["Is the queue<br/>above zero?"]
    Q2 t2@-->|"Yes"| Q3["Is the KV cache<br/>near full?"]
    Q2 t3@-->|"No"| Q4["Did the prefix<br/>hit rate drop?"]
    Q3 t4@-->|"Yes"| A1["Long prompts<br/>cap length"]
    Q3 t5@-->|"No"| A2["Too few<br/>replicas"]
    Q4 t6@-->|"Yes"| A3["Cache misses<br/>check routing"]
    Q4 t7@-->|"No"| A4["Longer<br/>prompts"]

    t1@{ animate: true }
    t2@{ animate: true }
    t3@{ animate: true }
    t4@{ animate: true }
    t5@{ animate: true }
    t6@{ animate: true }
    t7@{ animate: true }

    classDef warn fill:#302410,stroke:#fbbf24,color:#fff3cf,stroke-width:2px;
    classDef question fill:#281d48,stroke:#a78bfa,color:#f1edff,stroke-width:2px;
    classDef gpu fill:#173f59,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    class Q1 warn;
    class Q2,Q3,Q4 question;
    class A1,A2,A3,A4 gpu;</div>
  <figcaption>A short path for the most common complaint: the first token is slow. Check the queue first, then the cache. The fixes: cap prompt length or add memory, scale out, check prompt templates and routing, or look at who is sending more input tokens.</figcaption>
</figure>

<h2 id="the-four-alerts">The four alerts</h2>
<p>Dashboards are for looking. Alerts are for when nobody is looking. Keep the list short, and make every alert mean &ldquo;a user is affected or about to be&rdquo;.</p>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Alert</th>
            <th scope="col">Fires when</th>
            <th scope="col">Why this one</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Queue backlog</td>
            <td>Requests have been waiting for 2 minutes</td>
            <td>The earliest sign of overload</td>
        </tr>
        <tr>
            <td>Slow first token</td>
            <td>P95 TTFT is over target for 10 minutes</td>
            <td>What users actually feel</td>
        </tr>
        <tr>
            <td>KV cache nearly full</td>
            <td>Usage above 0.95 for 10 minutes</td>
            <td>Predicts the next queue backlog</td>
        </tr>
        <tr>
            <td>Server down</td>
            <td>A vLLM Pod stops answering scrapes</td>
            <td>Covers crashes and stuck Pods</td>
        </tr>
    </tbody>
  </table>
</div>
<p>With the Prometheus Operator, they fit in one <code>PrometheusRule</code>. Adjust the namespace, the thresholds, and the <code>job</code> label to match your setup:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="c"># vllm-alerts.yaml</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">monitoring.coreos.com/v1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">PrometheusRule</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">vllm-alerts</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">namespace</span><span class="p">:</span><span class="w"> </span><span class="l">llm</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">groups</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">vllm</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">rules</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">alert</span><span class="p">:</span><span class="w"> </span><span class="l">VLLMQueueBacklog</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">expr</span><span class="p">:</span><span class="w"> </span><span class="l">sum by (namespace) (vllm:num_requests_waiting) &gt; 5</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">for</span><span class="p">:</span><span class="w"> </span><span class="l">2m</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">severity</span><span class="p">:</span><span class="w"> </span><span class="l">warning</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">annotations</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">summary</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;vLLM has had requests waiting for 2 minutes&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;Capacity is exhausted. Check autoscaling and the KV cache panel.&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">alert</span><span class="p">:</span><span class="w"> </span><span class="l">VLLMSlowFirstToken</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">expr</span><span class="p">:</span><span class="w"> </span><span class="p">|</span><span class="sd">
</span></span></span><span class="line"><span class="cl"><span class="sd">            histogram_quantile(0.95,
</span></span></span><span class="line"><span class="cl"><span class="sd">              sum by (le, namespace) (rate(vllm:time_to_first_token_seconds_bucket[5m]))
</span></span></span><span class="line"><span class="cl"><span class="sd">            ) &gt; 2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">for</span><span class="p">:</span><span class="w"> </span><span class="l">10m</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">severity</span><span class="p">:</span><span class="w"> </span><span class="l">warning</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">annotations</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">summary</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;P95 time to first token is above 2 seconds&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">alert</span><span class="p">:</span><span class="w"> </span><span class="l">VLLMKVCacheNearlyFull</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">expr</span><span class="p">:</span><span class="w"> </span><span class="l">max by (namespace, pod) (vllm:kv_cache_usage_perc) &gt; 0.95</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">for</span><span class="p">:</span><span class="w"> </span><span class="l">10m</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">severity</span><span class="p">:</span><span class="w"> </span><span class="l">warning</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">annotations</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">summary</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;KV cache on {{ $labels.pod }} is above 95 percent&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">alert</span><span class="p">:</span><span class="w"> </span><span class="l">VLLMDown</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">expr</span><span class="p">:</span><span class="w"> </span><span class="l">up{job=&#34;llm/vllm&#34;} == 0</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">for</span><span class="p">:</span><span class="w"> </span><span class="l">2m</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">severity</span><span class="p">:</span><span class="w"> </span><span class="l">critical</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">annotations</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">summary</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;A vLLM Pod has stopped answering metric scrapes&#34;</span><span class="w">
</span></span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">kubectl apply -f vllm-alerts.yaml
</span></span></code></pre></div><p>Then confirm Prometheus loaded the rules:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">kubectl -n llm get prometheusrule vllm-alerts
</span></span></code></pre></div><p>Three choices in that file are deliberate:</p>
<ul>
<li><strong>Every alert has a <code>for</code> duration.</strong> A two-second blip should not page anyone.</li>
<li><strong>Thresholds come from your own target.</strong> The 2 seconds for TTFT is an example. Use the number you promised your users.</li>
<li><strong>There is no alert on GPU utilization.</strong> It is near 100% whenever the server is doing its job.</li>
</ul>
<p>The <code>job</code> label depends on how your scrape is configured. Find the real value with this query, then update the last rule:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">count by (job) (vllm:num_requests_running)
</span></span></code></pre></div><h2 id="mistakes-worth-avoiding">Mistakes worth avoiding</h2>
<div class="table-scroll">
  <table>
    <thead>
        <tr>
            <th scope="col">Mistake</th>
            <th scope="col">What goes wrong</th>
            <th scope="col">Do this instead</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Alerting on averages</td>
            <td>One slow request in a hundred never shows up</td>
            <td>Alert on P95 or P99</td>
        </tr>
        <tr>
            <td>Alerting on GPU utilization</td>
            <td>It fires all day, so everyone mutes it</td>
            <td>Alert on the queue</td>
        </tr>
        <tr>
            <td>One dashboard per Pod only</td>
            <td>You miss the fleet-wide picture</td>
            <td>Sum across Pods, then break down by Pod</td>
        </tr>
        <tr>
            <td>Short rate windows</td>
            <td>Graphs are too spiky to read</td>
            <td>Use 5 minute windows for latency</td>
        </tr>
        <tr>
            <td>No alert for missing data</td>
            <td>A dead server looks like a quiet one</td>
            <td>Keep the &ldquo;server down&rdquo; alert</td>
        </tr>
        <tr>
            <td>Watching only latency</td>
            <td>You see the symptom, not the cause</td>
            <td>Keep queue and KV cache next to it</td>
        </tr>
    </tbody>
  </table>
</div>
<h2 id="try-it-without-a-gpu">Try it without a GPU</h2>
<p>You can practice all of this on a laptop. The <a href="https://vishctl.dev/posts/simulate-gpu-vllm-llm-d-on-laptop/">GPU simulation lab</a> runs a simulated vLLM that publishes vLLM-style metrics, so the queue and latency queries have something to read. It exposes a subset of the real metric list, so run the <code>grep</code> command from earlier to see which panels will have data.</p>
<p>Once the panels work, connect them to action: the queue metric from panel 2 is the same signal that drives scaling in my <a href="https://vishctl.dev/posts/autoscaling-llm-inference-kubernetes-keda/">autoscaling guide</a>.</p>
<h2 id="cheat-sheet">Cheat sheet</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Model metrics      = what vLLM reports about requests; the view that shows user pain
</span></span><span class="line"><span class="cl">GPU metrics        = what the hardware reports; good for hardware faults, poor for load
</span></span><span class="line"><span class="cl">Gauge              = a value right now, such as requests waiting
</span></span><span class="line"><span class="cl">Counter            = a growing total; query it with rate() and a _total suffix
</span></span><span class="line"><span class="cl">Histogram          = a spread of timings; percentiles come from the _bucket series
</span></span><span class="line"><span class="cl">Queue panel        = requests waiting; should be flat at zero
</span></span><span class="line"><span class="cl">TTFT panel         = P50, P95, P99 time to first token
</span></span><span class="line"><span class="cl">KV cache usage     = 0 to 1; near 1 means no memory left for new context
</span></span><span class="line"><span class="cl">Prefix hit rate    = cached prompt tokens / all prompt tokens
</span></span><span class="line"><span class="cl">PrometheusRule     = the Prometheus Operator resource that holds alert rules
</span></span><span class="line"><span class="cl">for: 2m            = the condition must hold this long before the alert fires
</span></span><span class="line"><span class="cl">Rule of thumb      = alert on the queue and on P95 TTFT, never on GPU utilization
</span></span></code></pre></div><p>To understand the numbers on these panels, start with the <a href="https://vishctl.dev/posts/llm-inference-metrics-ttft-tpot-throughput-goodput/">inference metrics guide</a>. To act on them automatically, continue to <a href="https://vishctl.dev/posts/autoscaling-llm-inference-kubernetes-keda/">autoscaling LLM inference on Kubernetes</a>.</p>
]]></content:encoded></item></channel></rss>