Skip to content

feat(telemetry): scrape vLLM, gateway and GPU metrics and report the LLM pool's load - #569

Merged
dan-petty merged 2 commits into
release/v0.2.23from
feat/546-llm-metrics
Sep 25, 2026
Merged

dan-petty merged 2 commits into
release/v0.2.23from
feat/546-llm-metrics

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Prometheus scraped no vllm:*, litellm_* or GPU metric. #545's imbalance was found by exec-ing nvidia-smi in each pod, and llm-stack.json queried http_requests_total, which nothing in the stack exposes.

Scraping

  • vLLM servers and gateway: prometheus.additionalServiceMonitors in prometheus-values.yaml.

    • The chart creates these monitors itself, so they never wait on the ServiceMonitor CRD, which devops k8s up would otherwise apply before Helm.
    • job is the service name.
  • LiteLLM's Prometheus callback is on in the gateway config; it is open source in v1.102.1, checked in the running image. Per deployment it reports requests, failures and latency, which covers the Ollama nodes.

  • DCGM exporter: NVIDIA's chart (dcgm-exporter-values.yaml, 4.6.1-4.8.4-distroless) joins the infra stack.

    • It runs on nodes labelled nvidia.com/gpu.present, with the nvidia runtime class and the GPU taint tolerated.
    • It has no added capability: DCGM_FI_PROF_* fields need datacenter GPUs and SYS_ADMIN.

    serviceMonitorSelectorNilUsesHelmValues: false, so the chart's own monitor is selected.

  • Network policies: vLLM admits the monitoring namespace on 8000, and Prometheus may reach llm on 8000 and 4000.

Dashboard

llm-stack.json is rebuilt, with the Qdrant panels kept:

  • calls in flight, requests and failures per deployment;
  • vLLM running and waiting requests;
  • gateway p95 latency;
  • vLLM time to first token and queue time;
  • KV cache and token throughput;
  • GPU utilisation, memory, power and temperature.

Metric names were checked against:

  • the live vLLM v0.30.0 /metrics;
  • LiteLLM's exposition (prometheus_client appends _total to counters, e.g. litellm_deployment_total_requests_total);
  • DCGM's default counters.

devops ai gateway load --window 1h

Moved here from #557. For each backend it reports:

  • requests, failures and mean calls in flight (gateway call seconds per second);
  • for vLLM servers, busy share and mean/peak queue.

For each GPU it reports mean utilisation and peak memory. It prints a table or -f json.

Not verified in the cluster

Checked in tests, not applied. After merge:

  1. devops k8s up for the infra stack, which upgrades kube-prometheus-stack and installs the DCGM exporter.
  2. kubectl apply -k k8s/llm for the gateway config and network policies.
  3. Run devops ai gateway load --window 15m during a review.

Heads-up

#566 (not yet merged) also edits #546's roadmap line and task file. Whichever of the two merges second needs a small rebase.

Tests

tests/test_llm_pool_metrics.py (18 tests) covers:

  • dashboard metric names;
  • monitors against the Services' labels and ports;
  • network policies;
  • the gateway callback;
  • DCGM scheduling and privileges;
  • joining gateway and vLLM views of a backend;
  • windows;
  • the command's table, JSON, empty and error cases.

uv run devops ci --force: 13/13 gates pass.

Closes #546

…LLM pool's load

Prometheus scraped no vLLM, gateway or GPU metric, so the pool's load
was measured by exec-ing nvidia-smi in each pod, and llm-stack.json
queried http_requests_total, which nothing in the stack exposes.

kube-prometheus-stack now creates monitors for both vLLM servers and the
gateway, whose LiteLLM Prometheus callback reports each deployment's
requests, failures and latency (covering the Ollama nodes, which export
nothing). NVIDIA's DCGM exporter chart joins the infra stack on GPU
nodes with the NVIDIA runtime and no added capability. Network policies
let Prometheus reach the metrics ports. llm-stack.json is rebuilt on
metric names checked against each exporter.

`devops ai gateway load --window 1h` reports each backend's requests,
failures and mean calls in flight, each vLLM server's busy share and
queue, and each GPU's utilisation and peak memory.

Closes #546
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 25, 2026
@dan-petty dan-petty added type/feature Type feature: a new function scope/telemetry OpenTelemetry tracing spans, Prometheus metrics, and Jaeger priority/p1-high Priority P1: high-impact work for the next planned milestone labels Sep 25, 2026
@dan-petty
dan-petty enabled auto-merge (squash) September 25, 2026 02:11
…lm-metrics

# Conflicts:
#	docs/CLI_REFERENCE.md
#	docs/ROADMAP.md
#	docs/agent/tasks/task-546-llm-serving-and-gpu-metrics-in-prometheus.md
#	k8s/README.md
#	src/devops_cli/commands/ai_gateway.py
@dan-petty
dan-petty merged commit 807e47d into release/v0.2.23 Sep 25, 2026
7 checks passed
@dan-petty
dan-petty deleted the feat/546-llm-metrics branch September 25, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1-high Priority P1: high-impact work for the next planned milestone scope/telemetry OpenTelemetry tracing spans, Prometheus metrics, and Jaeger type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant