main
yaml 392 lines 15.2 KB
Raw
1 kind: PersesDashboard
2 metadata:
3 name: query-statistics
4 createdAt: 0001-01-01T00:00:00Z
5 updatedAt: 0001-01-01T00:00:00Z
6 version: 0
7 project: ""
8 spec:
9 display:
10 name: Query Statistics_New
11
12 variables:
13 - kind: ListVariable
14 spec:
15 name: NS
16 display: { name: Namespace }
17 allowMultiple: false
18 defaultValue: llm-d
19 plugin:
20 kind: PrometheusLabelValuesVariable
21 spec:
22 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
23 labelName: namespace
24 matchers:
25 - up{service=~".*vllm.*"}
26
27 - kind: ListVariable
28 spec:
29 name: SVC
30 display: { name: Service }
31 allowMultiple: false
32 defaultValue: vllm-qwen2-0-5b-sim
33 plugin:
34 kind: PrometheusLabelValuesVariable
35 spec:
36 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
37 labelName: service
38 matchers:
39 - up{namespace="$NS",service=~".*vllm.*"}
40
41 - kind: ListVariable
42 spec:
43 name: MODEL
44 display: { name: Model (real vLLM) }
45 allowAllValue: true
46 allowMultiple: true
47 defaultValue: ["$__all"]
48 plugin:
49 kind: PrometheusLabelValuesVariable
50 spec:
51 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
52 labelName: model_name
53 matchers:
54 - vllm:request_success_total{namespace="$NS",service="$SVC"}
55
56 panels:
57
58 # --- Core (works on Simulator & Real) ---
59 core_running_now:
60 kind: Panel
61 spec:
62 display: { name: Running Requests (now) }
63 plugin: { kind: StatChart, spec: { calculation: last-number } }
64 queries:
65 - kind: TimeSeriesQuery
66 spec:
67 plugin:
68 kind: PrometheusTimeSeriesQuery
69 spec:
70 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
71 query: sum(vllm:num_requests_running{namespace="$NS",service="$SVC"}) or vector(0)
72 minStep: "15s"
73
74 core_waiting_now:
75 kind: Panel
76 spec:
77 display: { name: Waiting Requests (now) }
78 plugin: { kind: StatChart, spec: { calculation: last-number } }
79 queries:
80 - kind: TimeSeriesQuery
81 spec:
82 plugin:
83 kind: PrometheusTimeSeriesQuery
84 spec:
85 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
86 query: sum(vllm:num_requests_waiting{namespace="$NS",service="$SVC"}) or vector(0)
87 minStep: "15s"
88
89 core_kv_usage_now:
90 kind: Panel
91 spec:
92 display: { name: KV Cache Usage (0–1) }
93 plugin: { kind: StatChart, spec: { calculation: last-number } }
94 queries:
95 - kind: TimeSeriesQuery
96 spec:
97 plugin:
98 kind: PrometheusTimeSeriesQuery
99 spec:
100 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
101 query: avg(vllm:kv_cache_usage_perc{namespace="$NS",service="$SVC"}) or vector(0)
102 minStep: "15s"
103
104 core_running_ts:
105 kind: Panel
106 spec:
107 display: { name: Running Over Time }
108 plugin:
109 kind: TimeSeriesChart
110 spec:
111 legend: { mode: table, position: bottom }
112 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
113 queries:
114 - kind: TimeSeriesQuery
115 spec:
116 plugin:
117 kind: PrometheusTimeSeriesQuery
118 spec:
119 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
120 query: sum by (service) (vllm:num_requests_running{namespace="$NS",service="$SVC"}) or vector(0)
121 minStep: "15s"
122
123 core_waiting_ts:
124 kind: Panel
125 spec:
126 display: { name: Waiting Over Time }
127 plugin:
128 kind: TimeSeriesChart
129 spec:
130 legend: { mode: table, position: bottom }
131 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
132 queries:
133 - kind: TimeSeriesQuery
134 spec:
135 plugin:
136 kind: PrometheusTimeSeriesQuery
137 spec:
138 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
139 query: sum by (service) (vllm:num_requests_waiting{namespace="$NS",service="$SVC"}) or vector(0)
140 minStep: "15s"
141
142 core_targets_up:
143 kind: Panel
144 spec:
145 display: { name: Scrape Targets Up }
146 plugin: { kind: StatChart, spec: { calculation: last-number } }
147 queries:
148 - kind: TimeSeriesQuery
149 spec:
150 plugin:
151 kind: PrometheusTimeSeriesQuery
152 spec:
153 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
154 query: count(up{namespace="$NS",service="$SVC"} == 1) or vector(0)
155 minStep: "15s"
156
157 # --- KV Cache as Percent (works on Simulator & Real) ---
158 core_kv_usage_pct_now:
159 kind: Panel
160 spec:
161 display: { name: KV Cache Usage (%) – now }
162 plugin: { kind: StatChart, spec: { calculation: last-number } }
163 queries:
164 - kind: TimeSeriesQuery
165 spec:
166 plugin:
167 kind: PrometheusTimeSeriesQuery
168 spec:
169 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
170 # multiply by 100 to present percentage; omit format.unit to avoid schema conflicts
171 query: (avg(vllm:kv_cache_usage_perc{namespace="$NS",service="$SVC"}) * 100) or vector(0)
172 minStep: "15s"
173
174 core_kv_usage_pct_ts:
175 kind: Panel
176 spec:
177 display: { name: KV Cache Usage (%) – over time }
178 plugin:
179 kind: TimeSeriesChart
180 spec:
181 legend: { mode: table, position: bottom }
182 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
183 queries:
184 - kind: TimeSeriesQuery
185 spec:
186 plugin:
187 kind: PrometheusTimeSeriesQuery
188 spec:
189 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
190 query: (avg by (service) (vllm:kv_cache_usage_perc{namespace="$NS",service="$SVC"}) * 100) or vector(0)
191 minStep: "15s"
192
193 # --- Per-Pod breakdowns (works on Simulator & Real) ---
194 per_pod_running_ts:
195 kind: Panel
196 spec:
197 display: { name: Running by Pod }
198 plugin:
199 kind: TimeSeriesChart
200 spec:
201 legend: { mode: table, position: bottom }
202 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
203 queries:
204 - kind: TimeSeriesQuery
205 spec:
206 plugin:
207 kind: PrometheusTimeSeriesQuery
208 spec:
209 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
210 query: sum by (pod) (vllm:num_requests_running{namespace="$NS",service="$SVC"}) or vector(0)
211 minStep: "15s"
212
213 per_pod_waiting_ts:
214 kind: Panel
215 spec:
216 display: { name: Waiting by Pod }
217 plugin:
218 kind: TimeSeriesChart
219 spec:
220 legend: { mode: table, position: bottom }
221 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
222 queries:
223 - kind: TimeSeriesQuery
224 spec:
225 plugin:
226 kind: PrometheusTimeSeriesQuery
227 spec:
228 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
229 query: sum by (pod) (vllm:num_requests_waiting{namespace="$NS",service="$SVC"}) or vector(0)
230 minStep: "15s"
231
232 per_pod_kv_pct_ts:
233 kind: Panel
234 spec:
235 display: { name: KV Cache (%) by Pod }
236 plugin:
237 kind: TimeSeriesChart
238 spec:
239 legend: { mode: table, position: bottom }
240 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
241 queries:
242 - kind: TimeSeriesQuery
243 spec:
244 plugin:
245 kind: PrometheusTimeSeriesQuery
246 spec:
247 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
248 # if your exporter labels kv metric with pod (the sim does), this works; otherwise it will just return empty
249 query: (avg by (pod) (vllm:kv_cache_usage_perc{namespace="$NS",service="$SVC"}) * 100) or vector(0)
250 minStep: "15s"
251
252 # --- Real vLLM only (zeros on simulator) ---
253 real_req_rate_ts:
254 kind: Panel
255 spec:
256 display: { name: Request Rate (real vLLM) }
257 plugin:
258 kind: TimeSeriesChart
259 spec:
260 legend: { mode: table, position: bottom }
261 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
262 queries:
263 - kind: TimeSeriesQuery
264 spec:
265 plugin:
266 kind: PrometheusTimeSeriesQuery
267 spec:
268 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
269 query: sum by (model_name) (rate(vllm:request_success_total{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval])) or vector(0)
270 minStep: "15s"
271
272 real_p50:
273 kind: Panel
274 spec:
275 display: { name: p50 Latency (real vLLM) }
276 plugin: { kind: StatChart, spec: { calculation: last-number } }
277 queries:
278 - kind: TimeSeriesQuery
279 spec:
280 plugin:
281 kind: PrometheusTimeSeriesQuery
282 spec:
283 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
284 query: histogram_quantile(0.50, sum by (le, model_name) (rate(vllm:e2e_request_latency_seconds_bucket{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval]))) or vector(0)
285 minStep: "15s"
286
287 real_p90:
288 kind: Panel
289 spec:
290 display: { name: p90 Latency (real vLLM) }
291 plugin: { kind: StatChart, spec: { calculation: last-number } }
292 queries:
293 - kind: TimeSeriesQuery
294 spec:
295 plugin:
296 kind: PrometheusTimeSeriesQuery
297 spec:
298 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
299 query: histogram_quantile(0.90, sum by (le, model_name) (rate(vllm:e2e_request_latency_seconds_bucket{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval]))) or vector(0)
300 minStep: "15s"
301
302 real_p99:
303 kind: Panel
304 spec:
305 display: { name: p99 Latency (real vLLM) }
306 plugin: { kind: StatChart, spec: { calculation: last-number } }
307 queries:
308 - kind: TimeSeriesQuery
309 spec:
310 plugin:
311 kind: PrometheusTimeSeriesQuery
312 spec:
313 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
314 query: histogram_quantile(0.99, sum by (le, model_name) (rate(vllm:e2e_request_latency_seconds_bucket{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval]))) or vector(0)
315 minStep: "15s"
316
317 real_input_tokens_ts:
318 kind: Panel
319 spec:
320 display: { name: Input Tokens / sec (real vLLM) }
321 plugin:
322 kind: TimeSeriesChart
323 spec:
324 legend: { mode: table, position: bottom }
325 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
326 queries:
327 - kind: TimeSeriesQuery
328 spec:
329 plugin:
330 kind: PrometheusTimeSeriesQuery
331 spec:
332 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
333 query: sum by (model_name) (rate(vllm:prompt_tokens_total{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval])) or vector(0)
334 minStep: "15s"
335
336 real_output_tokens_ts:
337 kind: Panel
338 spec:
339 display: { name: Output Tokens / sec (real vLLM) }
340 plugin:
341 kind: TimeSeriesChart
342 spec:
343 legend: { mode: table, position: bottom }
344 visual: { display: line, lineWidth: 1, areaOpacity: 0.3 }
345 queries:
346 - kind: TimeSeriesQuery
347 spec:
348 plugin:
349 kind: PrometheusTimeSeriesQuery
350 spec:
351 datasource: { kind: PrometheusDatasource, name: accelerators-thanos-querier-datasource }
352 query: sum by (model_name) (rate(vllm:generation_tokens_total{namespace="$NS",service="$SVC",model_name=~"$MODEL"}[$__interval])) or vector(0)
353 minStep: "15s"
354
355 layouts:
356 - kind: Grid
357 spec:
358 display: { title: Core (Sim & Real) }
359 items:
360 - { x: 0, y: 0, width: 6, height: 3, content: { $ref: '#/spec/panels/core_running_now' } }
361 - { x: 6, y: 0, width: 6, height: 3, content: { $ref: '#/spec/panels/core_waiting_now' } }
362 - { x: 12, y: 0, width: 6, height: 3, content: { $ref: '#/spec/panels/core_kv_usage_now' } }
363 - { x: 18, y: 0, width: 6, height: 3, content: { $ref: '#/spec/panels/core_targets_up' } }
364 - { x: 0, y: 3, width: 12, height: 6, content: { $ref: '#/spec/panels/core_running_ts' } }
365 - { x: 12, y: 3, width: 12, height: 6, content: { $ref: '#/spec/panels/core_waiting_ts' } }
366
367 - kind: Grid
368 spec:
369 display: { title: KV Cache (%) }
370 items:
371 - { x: 0, y: 9, width: 6, height: 3, content: { $ref: '#/spec/panels/core_kv_usage_pct_now' } }
372 - { x: 6, y: 9, width: 18, height: 6, content: { $ref: '#/spec/panels/core_kv_usage_pct_ts' } }
373
374 - kind: Grid
375 spec:
376 display: { title: Per-Pod breakdowns }
377 items:
378 - { x: 0, y: 15, width: 12, height: 6, content: { $ref: '#/spec/panels/per_pod_running_ts' } }
379 - { x: 12, y: 15, width: 12, height: 6, content: { $ref: '#/spec/panels/per_pod_waiting_ts' } }
380 - { x: 0, y: 21, width: 24, height: 6, content: { $ref: '#/spec/panels/per_pod_kv_pct_ts' } }
381
382 - kind: Grid
383 spec:
384 display: { title: Real vLLM only (shows 0 on simulator) }
385 items:
386 - { x: 0, y: 27, width: 12, height: 6, content: { $ref: '#/spec/panels/real_req_rate_ts' } }
387 - { x: 12, y: 27, width: 4, height: 3, content: { $ref: '#/spec/panels/real_p50' } }
388 - { x: 16, y: 27, width: 4, height: 3, content: { $ref: '#/spec/panels/real_p90' } }
389 - { x: 20, y: 27, width: 4, height: 3, content: { $ref: '#/spec/panels/real_p99' } }
390 - { x: 0, y: 33, width: 12, height: 6, content: { $ref: '#/spec/panels/real_input_tokens_ts' } }
391 - { x: 12, y: 33, width: 12, height: 6, content: { $ref: '#/spec/panels/real_output_tokens_ts' } }
392