Paramjit Singh commited on
Commit
b1a5e35
·
unverified ·
2 Parent(s): de9a3940d9e5ea

Merge pull request #338 from Srushti-Kamble14/feat/grafana-dashboard-templates

Browse files
Files changed (1) hide show
  1. grafana_dashboard.json +1025 -0
grafana_dashboard.json ADDED
@@ -0,0 +1,1025 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "annotations": {
3
+ "list": [
4
+ {
5
+ "builtIn": 1,
6
+ "datasource": {
7
+ "type": "grafana",
8
+ "uid": "-- Grafana --"
9
+ },
10
+ "enable": true,
11
+ "hide": true,
12
+ "iconColor": "rgba(0, 211, 255, 1)",
13
+ "name": "Annotations & Alerts",
14
+ "type": "dashboard"
15
+ }
16
+ ]
17
+ },
18
+ "description": "System monitoring dashboard for PDF-Assistant-RAG covering API latency, LLM token usage, active users, request volume, error rate, and backend memory.",
19
+ "editable": true,
20
+ "fiscalYearStartMonth": 0,
21
+ "graphTooltip": 1,
22
+ "id": null,
23
+ "links": [],
24
+ "liveNow": false,
25
+ "panels": [
26
+ {
27
+ "collapsed": false,
28
+ "gridPos": {
29
+ "h": 1,
30
+ "w": 24,
31
+ "x": 0,
32
+ "y": 0
33
+ },
34
+ "id": 1,
35
+ "panels": [],
36
+ "title": "Service Overview",
37
+ "type": "row"
38
+ },
39
+ {
40
+ "datasource": {
41
+ "type": "prometheus",
42
+ "uid": "${DS_PROMETHEUS}"
43
+ },
44
+ "fieldConfig": {
45
+ "defaults": {
46
+ "color": {
47
+ "mode": "thresholds"
48
+ },
49
+ "decimals": 0,
50
+ "mappings": [],
51
+ "thresholds": {
52
+ "mode": "absolute",
53
+ "steps": [
54
+ {
55
+ "color": "green",
56
+ "value": null
57
+ },
58
+ {
59
+ "color": "yellow",
60
+ "value": 500
61
+ },
62
+ {
63
+ "color": "red",
64
+ "value": 1500
65
+ }
66
+ ]
67
+ },
68
+ "unit": "ms"
69
+ },
70
+ "overrides": []
71
+ },
72
+ "gridPos": {
73
+ "h": 4,
74
+ "w": 6,
75
+ "x": 0,
76
+ "y": 1
77
+ },
78
+ "id": 2,
79
+ "options": {
80
+ "colorMode": "background",
81
+ "graphMode": "area",
82
+ "justifyMode": "auto",
83
+ "orientation": "auto",
84
+ "reduceOptions": {
85
+ "calcs": [
86
+ "lastNotNull"
87
+ ],
88
+ "fields": "",
89
+ "values": false
90
+ },
91
+ "textMode": "auto"
92
+ },
93
+ "pluginVersion": "10.4.0",
94
+ "targets": [
95
+ {
96
+ "datasource": {
97
+ "type": "prometheus",
98
+ "uid": "${DS_PROMETHEUS}"
99
+ },
100
+ "editorMode": "code",
101
+ "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{handler=~\"$handler\"}[$__rate_interval])) by (le)) * 1000",
102
+ "legendFormat": "p95 latency",
103
+ "range": true,
104
+ "refId": "A"
105
+ }
106
+ ],
107
+ "title": "API p95 Latency",
108
+ "type": "stat"
109
+ },
110
+ {
111
+ "datasource": {
112
+ "type": "prometheus",
113
+ "uid": "${DS_PROMETHEUS}"
114
+ },
115
+ "fieldConfig": {
116
+ "defaults": {
117
+ "color": {
118
+ "mode": "palette-classic"
119
+ },
120
+ "decimals": 2,
121
+ "mappings": [],
122
+ "thresholds": {
123
+ "mode": "absolute",
124
+ "steps": [
125
+ {
126
+ "color": "blue",
127
+ "value": null
128
+ }
129
+ ]
130
+ },
131
+ "unit": "reqps"
132
+ },
133
+ "overrides": []
134
+ },
135
+ "gridPos": {
136
+ "h": 4,
137
+ "w": 6,
138
+ "x": 6,
139
+ "y": 1
140
+ },
141
+ "id": 3,
142
+ "options": {
143
+ "colorMode": "background",
144
+ "graphMode": "area",
145
+ "justifyMode": "auto",
146
+ "orientation": "auto",
147
+ "reduceOptions": {
148
+ "calcs": [
149
+ "lastNotNull"
150
+ ],
151
+ "fields": "",
152
+ "values": false
153
+ },
154
+ "textMode": "auto"
155
+ },
156
+ "pluginVersion": "10.4.0",
157
+ "targets": [
158
+ {
159
+ "datasource": {
160
+ "type": "prometheus",
161
+ "uid": "${DS_PROMETHEUS}"
162
+ },
163
+ "editorMode": "code",
164
+ "expr": "sum(rate(http_requests_total{handler=~\"$handler\"}[$__rate_interval]))",
165
+ "legendFormat": "requests/sec",
166
+ "range": true,
167
+ "refId": "A"
168
+ }
169
+ ],
170
+ "title": "API Throughput",
171
+ "type": "stat"
172
+ },
173
+ {
174
+ "datasource": {
175
+ "type": "prometheus",
176
+ "uid": "${DS_PROMETHEUS}"
177
+ },
178
+ "description": "Requires an application counter named llm_tokens_total with labels such as direction=\"input|output\".",
179
+ "fieldConfig": {
180
+ "defaults": {
181
+ "color": {
182
+ "mode": "continuous-BlPu"
183
+ },
184
+ "decimals": 0,
185
+ "mappings": [],
186
+ "thresholds": {
187
+ "mode": "absolute",
188
+ "steps": [
189
+ {
190
+ "color": "purple",
191
+ "value": null
192
+ }
193
+ ]
194
+ },
195
+ "unit": "short"
196
+ },
197
+ "overrides": []
198
+ },
199
+ "gridPos": {
200
+ "h": 4,
201
+ "w": 6,
202
+ "x": 12,
203
+ "y": 1
204
+ },
205
+ "id": 4,
206
+ "options": {
207
+ "colorMode": "background",
208
+ "graphMode": "area",
209
+ "justifyMode": "auto",
210
+ "orientation": "auto",
211
+ "reduceOptions": {
212
+ "calcs": [
213
+ "lastNotNull"
214
+ ],
215
+ "fields": "",
216
+ "values": false
217
+ },
218
+ "textMode": "auto"
219
+ },
220
+ "pluginVersion": "10.4.0",
221
+ "targets": [
222
+ {
223
+ "datasource": {
224
+ "type": "prometheus",
225
+ "uid": "${DS_PROMETHEUS}"
226
+ },
227
+ "editorMode": "code",
228
+ "expr": "sum(rate(llm_tokens_total[$__rate_interval])) * 60",
229
+ "legendFormat": "tokens/min",
230
+ "range": true,
231
+ "refId": "A"
232
+ }
233
+ ],
234
+ "title": "LLM Tokens / min",
235
+ "type": "stat"
236
+ },
237
+ {
238
+ "datasource": {
239
+ "type": "prometheus",
240
+ "uid": "${DS_PROMETHEUS}"
241
+ },
242
+ "description": "Requires an application gauge named active_users.",
243
+ "fieldConfig": {
244
+ "defaults": {
245
+ "color": {
246
+ "mode": "continuous-GrYlRd"
247
+ },
248
+ "decimals": 0,
249
+ "mappings": [],
250
+ "thresholds": {
251
+ "mode": "absolute",
252
+ "steps": [
253
+ {
254
+ "color": "green",
255
+ "value": null
256
+ },
257
+ {
258
+ "color": "yellow",
259
+ "value": 100
260
+ },
261
+ {
262
+ "color": "red",
263
+ "value": 500
264
+ }
265
+ ]
266
+ },
267
+ "unit": "short"
268
+ },
269
+ "overrides": []
270
+ },
271
+ "gridPos": {
272
+ "h": 4,
273
+ "w": 6,
274
+ "x": 18,
275
+ "y": 1
276
+ },
277
+ "id": 5,
278
+ "options": {
279
+ "colorMode": "background",
280
+ "graphMode": "area",
281
+ "justifyMode": "auto",
282
+ "orientation": "auto",
283
+ "reduceOptions": {
284
+ "calcs": [
285
+ "lastNotNull"
286
+ ],
287
+ "fields": "",
288
+ "values": false
289
+ },
290
+ "textMode": "auto"
291
+ },
292
+ "pluginVersion": "10.4.0",
293
+ "targets": [
294
+ {
295
+ "datasource": {
296
+ "type": "prometheus",
297
+ "uid": "${DS_PROMETHEUS}"
298
+ },
299
+ "editorMode": "code",
300
+ "expr": "sum(active_users)",
301
+ "legendFormat": "active users",
302
+ "range": true,
303
+ "refId": "A"
304
+ }
305
+ ],
306
+ "title": "Active Users",
307
+ "type": "stat"
308
+ },
309
+ {
310
+ "collapsed": false,
311
+ "gridPos": {
312
+ "h": 1,
313
+ "w": 24,
314
+ "x": 0,
315
+ "y": 5
316
+ },
317
+ "id": 6,
318
+ "panels": [],
319
+ "title": "API Health",
320
+ "type": "row"
321
+ },
322
+ {
323
+ "datasource": {
324
+ "type": "prometheus",
325
+ "uid": "${DS_PROMETHEUS}"
326
+ },
327
+ "fieldConfig": {
328
+ "defaults": {
329
+ "custom": {
330
+ "drawStyle": "line",
331
+ "fillOpacity": 18,
332
+ "gradientMode": "opacity",
333
+ "lineInterpolation": "smooth",
334
+ "lineWidth": 2,
335
+ "pointSize": 5,
336
+ "showPoints": "never",
337
+ "spanNulls": false
338
+ },
339
+ "mappings": [],
340
+ "thresholds": {
341
+ "mode": "absolute",
342
+ "steps": [
343
+ {
344
+ "color": "green",
345
+ "value": null
346
+ }
347
+ ]
348
+ },
349
+ "unit": "ms"
350
+ },
351
+ "overrides": []
352
+ },
353
+ "gridPos": {
354
+ "h": 8,
355
+ "w": 12,
356
+ "x": 0,
357
+ "y": 6
358
+ },
359
+ "id": 7,
360
+ "options": {
361
+ "legend": {
362
+ "calcs": [
363
+ "lastNotNull",
364
+ "max"
365
+ ],
366
+ "displayMode": "table",
367
+ "placement": "bottom",
368
+ "showLegend": true
369
+ },
370
+ "tooltip": {
371
+ "mode": "multi",
372
+ "sort": "desc"
373
+ }
374
+ },
375
+ "targets": [
376
+ {
377
+ "datasource": {
378
+ "type": "prometheus",
379
+ "uid": "${DS_PROMETHEUS}"
380
+ },
381
+ "editorMode": "code",
382
+ "expr": "histogram_quantile(0.50, sum(rate(http_request_duration_seconds_bucket{handler=~\"$handler\"}[$__rate_interval])) by (le)) * 1000",
383
+ "legendFormat": "p50",
384
+ "range": true,
385
+ "refId": "A"
386
+ },
387
+ {
388
+ "datasource": {
389
+ "type": "prometheus",
390
+ "uid": "${DS_PROMETHEUS}"
391
+ },
392
+ "editorMode": "code",
393
+ "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{handler=~\"$handler\"}[$__rate_interval])) by (le)) * 1000",
394
+ "legendFormat": "p95",
395
+ "range": true,
396
+ "refId": "B"
397
+ },
398
+ {
399
+ "datasource": {
400
+ "type": "prometheus",
401
+ "uid": "${DS_PROMETHEUS}"
402
+ },
403
+ "editorMode": "code",
404
+ "expr": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{handler=~\"$handler\"}[$__rate_interval])) by (le)) * 1000",
405
+ "legendFormat": "p99",
406
+ "range": true,
407
+ "refId": "C"
408
+ }
409
+ ],
410
+ "title": "API Latency Percentiles",
411
+ "type": "timeseries"
412
+ },
413
+ {
414
+ "datasource": {
415
+ "type": "prometheus",
416
+ "uid": "${DS_PROMETHEUS}"
417
+ },
418
+ "fieldConfig": {
419
+ "defaults": {
420
+ "color": {
421
+ "mode": "palette-classic"
422
+ },
423
+ "custom": {
424
+ "drawStyle": "line",
425
+ "fillOpacity": 20,
426
+ "gradientMode": "opacity",
427
+ "lineInterpolation": "smooth",
428
+ "lineWidth": 2,
429
+ "pointSize": 4,
430
+ "showPoints": "never",
431
+ "spanNulls": false
432
+ },
433
+ "mappings": [],
434
+ "thresholds": {
435
+ "mode": "absolute",
436
+ "steps": [
437
+ {
438
+ "color": "green",
439
+ "value": null
440
+ }
441
+ ]
442
+ },
443
+ "unit": "reqps"
444
+ },
445
+ "overrides": []
446
+ },
447
+ "gridPos": {
448
+ "h": 8,
449
+ "w": 12,
450
+ "x": 12,
451
+ "y": 6
452
+ },
453
+ "id": 8,
454
+ "options": {
455
+ "legend": {
456
+ "calcs": [
457
+ "lastNotNull"
458
+ ],
459
+ "displayMode": "table",
460
+ "placement": "bottom",
461
+ "showLegend": true
462
+ },
463
+ "tooltip": {
464
+ "mode": "multi",
465
+ "sort": "desc"
466
+ }
467
+ },
468
+ "targets": [
469
+ {
470
+ "datasource": {
471
+ "type": "prometheus",
472
+ "uid": "${DS_PROMETHEUS}"
473
+ },
474
+ "editorMode": "code",
475
+ "expr": "sum(rate(http_requests_total{handler=~\"$handler\"}[$__rate_interval])) by (handler)",
476
+ "legendFormat": "{{handler}}",
477
+ "range": true,
478
+ "refId": "A"
479
+ }
480
+ ],
481
+ "title": "Request Rate by Route",
482
+ "type": "timeseries"
483
+ },
484
+ {
485
+ "datasource": {
486
+ "type": "prometheus",
487
+ "uid": "${DS_PROMETHEUS}"
488
+ },
489
+ "fieldConfig": {
490
+ "defaults": {
491
+ "color": {
492
+ "mode": "thresholds"
493
+ },
494
+ "custom": {
495
+ "drawStyle": "line",
496
+ "fillOpacity": 25,
497
+ "gradientMode": "opacity",
498
+ "lineInterpolation": "smooth",
499
+ "lineWidth": 2,
500
+ "pointSize": 4,
501
+ "showPoints": "never",
502
+ "spanNulls": false
503
+ },
504
+ "mappings": [],
505
+ "thresholds": {
506
+ "mode": "absolute",
507
+ "steps": [
508
+ {
509
+ "color": "green",
510
+ "value": null
511
+ },
512
+ {
513
+ "color": "yellow",
514
+ "value": 1
515
+ },
516
+ {
517
+ "color": "red",
518
+ "value": 5
519
+ }
520
+ ]
521
+ },
522
+ "unit": "percent"
523
+ },
524
+ "overrides": []
525
+ },
526
+ "gridPos": {
527
+ "h": 7,
528
+ "w": 12,
529
+ "x": 0,
530
+ "y": 14
531
+ },
532
+ "id": 9,
533
+ "options": {
534
+ "legend": {
535
+ "calcs": [
536
+ "lastNotNull",
537
+ "max"
538
+ ],
539
+ "displayMode": "table",
540
+ "placement": "bottom",
541
+ "showLegend": true
542
+ },
543
+ "tooltip": {
544
+ "mode": "multi",
545
+ "sort": "desc"
546
+ }
547
+ },
548
+ "targets": [
549
+ {
550
+ "datasource": {
551
+ "type": "prometheus",
552
+ "uid": "${DS_PROMETHEUS}"
553
+ },
554
+ "editorMode": "code",
555
+ "expr": "100 * sum(rate(http_requests_total{handler=~\"$handler\", status=~\"5..\"}[$__rate_interval])) / clamp_min(sum(rate(http_requests_total{handler=~\"$handler\"}[$__rate_interval])), 0.001)",
556
+ "legendFormat": "5xx error rate",
557
+ "range": true,
558
+ "refId": "A"
559
+ }
560
+ ],
561
+ "title": "API Error Rate",
562
+ "type": "timeseries"
563
+ },
564
+ {
565
+ "datasource": {
566
+ "type": "prometheus",
567
+ "uid": "${DS_PROMETHEUS}"
568
+ },
569
+ "fieldConfig": {
570
+ "defaults": {
571
+ "custom": {
572
+ "align": "auto",
573
+ "cellOptions": {
574
+ "type": "color-background"
575
+ },
576
+ "inspect": false
577
+ },
578
+ "mappings": [],
579
+ "thresholds": {
580
+ "mode": "absolute",
581
+ "steps": [
582
+ {
583
+ "color": "green",
584
+ "value": null
585
+ },
586
+ {
587
+ "color": "yellow",
588
+ "value": 500
589
+ },
590
+ {
591
+ "color": "red",
592
+ "value": 1500
593
+ }
594
+ ]
595
+ },
596
+ "unit": "ms"
597
+ },
598
+ "overrides": []
599
+ },
600
+ "gridPos": {
601
+ "h": 7,
602
+ "w": 12,
603
+ "x": 12,
604
+ "y": 14
605
+ },
606
+ "id": 10,
607
+ "options": {
608
+ "cellHeight": "sm",
609
+ "footer": {
610
+ "countRows": false,
611
+ "fields": "",
612
+ "reducer": [
613
+ "sum"
614
+ ],
615
+ "show": false
616
+ },
617
+ "showHeader": true
618
+ },
619
+ "pluginVersion": "10.4.0",
620
+ "targets": [
621
+ {
622
+ "datasource": {
623
+ "type": "prometheus",
624
+ "uid": "${DS_PROMETHEUS}"
625
+ },
626
+ "editorMode": "code",
627
+ "expr": "topk(10, sum(rate(http_request_duration_seconds_sum{handler=~\"$handler\"}[$__rate_interval])) by (handler) / clamp_min(sum(rate(http_request_duration_seconds_count{handler=~\"$handler\"}[$__rate_interval])) by (handler), 0.001) * 1000)",
628
+ "format": "table",
629
+ "instant": true,
630
+ "legendFormat": "{{handler}}",
631
+ "refId": "A"
632
+ }
633
+ ],
634
+ "title": "Slowest Routes - Average Latency",
635
+ "type": "table"
636
+ },
637
+ {
638
+ "collapsed": false,
639
+ "gridPos": {
640
+ "h": 1,
641
+ "w": 24,
642
+ "x": 0,
643
+ "y": 21
644
+ },
645
+ "id": 11,
646
+ "panels": [],
647
+ "title": "LLM and User Activity",
648
+ "type": "row"
649
+ },
650
+ {
651
+ "datasource": {
652
+ "type": "prometheus",
653
+ "uid": "${DS_PROMETHEUS}"
654
+ },
655
+ "description": "Requires llm_tokens_total. Suggested labels: direction, model, route.",
656
+ "fieldConfig": {
657
+ "defaults": {
658
+ "color": {
659
+ "mode": "palette-classic"
660
+ },
661
+ "custom": {
662
+ "drawStyle": "line",
663
+ "fillOpacity": 25,
664
+ "gradientMode": "opacity",
665
+ "lineInterpolation": "smooth",
666
+ "lineWidth": 2,
667
+ "pointSize": 4,
668
+ "showPoints": "never",
669
+ "spanNulls": false
670
+ },
671
+ "mappings": [],
672
+ "thresholds": {
673
+ "mode": "absolute",
674
+ "steps": [
675
+ {
676
+ "color": "green",
677
+ "value": null
678
+ }
679
+ ]
680
+ },
681
+ "unit": "short"
682
+ },
683
+ "overrides": []
684
+ },
685
+ "gridPos": {
686
+ "h": 8,
687
+ "w": 12,
688
+ "x": 0,
689
+ "y": 22
690
+ },
691
+ "id": 12,
692
+ "options": {
693
+ "legend": {
694
+ "calcs": [
695
+ "lastNotNull",
696
+ "sum"
697
+ ],
698
+ "displayMode": "table",
699
+ "placement": "bottom",
700
+ "showLegend": true
701
+ },
702
+ "tooltip": {
703
+ "mode": "multi",
704
+ "sort": "desc"
705
+ }
706
+ },
707
+ "targets": [
708
+ {
709
+ "datasource": {
710
+ "type": "prometheus",
711
+ "uid": "${DS_PROMETHEUS}"
712
+ },
713
+ "editorMode": "code",
714
+ "expr": "sum(rate(llm_tokens_total[$__rate_interval])) by (direction) * 60",
715
+ "legendFormat": "{{direction}} tokens/min",
716
+ "range": true,
717
+ "refId": "A"
718
+ }
719
+ ],
720
+ "title": "LLM Token Usage by Direction",
721
+ "type": "timeseries"
722
+ },
723
+ {
724
+ "datasource": {
725
+ "type": "prometheus",
726
+ "uid": "${DS_PROMETHEUS}"
727
+ },
728
+ "description": "Requires active_users gauge. Optional labels such as auth_provider or plan are supported.",
729
+ "fieldConfig": {
730
+ "defaults": {
731
+ "color": {
732
+ "mode": "continuous-GrYlRd"
733
+ },
734
+ "custom": {
735
+ "drawStyle": "line",
736
+ "fillOpacity": 30,
737
+ "gradientMode": "opacity",
738
+ "lineInterpolation": "smooth",
739
+ "lineWidth": 2,
740
+ "pointSize": 4,
741
+ "showPoints": "never",
742
+ "spanNulls": false
743
+ },
744
+ "mappings": [],
745
+ "thresholds": {
746
+ "mode": "absolute",
747
+ "steps": [
748
+ {
749
+ "color": "green",
750
+ "value": null
751
+ }
752
+ ]
753
+ },
754
+ "unit": "short"
755
+ },
756
+ "overrides": []
757
+ },
758
+ "gridPos": {
759
+ "h": 8,
760
+ "w": 12,
761
+ "x": 12,
762
+ "y": 22
763
+ },
764
+ "id": 13,
765
+ "options": {
766
+ "legend": {
767
+ "calcs": [
768
+ "lastNotNull",
769
+ "max"
770
+ ],
771
+ "displayMode": "table",
772
+ "placement": "bottom",
773
+ "showLegend": true
774
+ },
775
+ "tooltip": {
776
+ "mode": "multi",
777
+ "sort": "desc"
778
+ }
779
+ },
780
+ "targets": [
781
+ {
782
+ "datasource": {
783
+ "type": "prometheus",
784
+ "uid": "${DS_PROMETHEUS}"
785
+ },
786
+ "editorMode": "code",
787
+ "expr": "sum(active_users)",
788
+ "legendFormat": "active users",
789
+ "range": true,
790
+ "refId": "A"
791
+ }
792
+ ],
793
+ "title": "Active Users Over Time",
794
+ "type": "timeseries"
795
+ },
796
+ {
797
+ "collapsed": false,
798
+ "gridPos": {
799
+ "h": 1,
800
+ "w": 24,
801
+ "x": 0,
802
+ "y": 30
803
+ },
804
+ "id": 14,
805
+ "panels": [],
806
+ "title": "Runtime",
807
+ "type": "row"
808
+ },
809
+ {
810
+ "datasource": {
811
+ "type": "prometheus",
812
+ "uid": "${DS_PROMETHEUS}"
813
+ },
814
+ "fieldConfig": {
815
+ "defaults": {
816
+ "color": {
817
+ "mode": "palette-classic"
818
+ },
819
+ "custom": {
820
+ "drawStyle": "line",
821
+ "fillOpacity": 20,
822
+ "gradientMode": "opacity",
823
+ "lineInterpolation": "smooth",
824
+ "lineWidth": 2,
825
+ "pointSize": 4,
826
+ "showPoints": "never",
827
+ "spanNulls": false
828
+ },
829
+ "mappings": [],
830
+ "thresholds": {
831
+ "mode": "absolute",
832
+ "steps": [
833
+ {
834
+ "color": "green",
835
+ "value": null
836
+ }
837
+ ]
838
+ },
839
+ "unit": "decbytes"
840
+ },
841
+ "overrides": []
842
+ },
843
+ "gridPos": {
844
+ "h": 7,
845
+ "w": 12,
846
+ "x": 0,
847
+ "y": 31
848
+ },
849
+ "id": 15,
850
+ "options": {
851
+ "legend": {
852
+ "calcs": [
853
+ "lastNotNull",
854
+ "max"
855
+ ],
856
+ "displayMode": "table",
857
+ "placement": "bottom",
858
+ "showLegend": true
859
+ },
860
+ "tooltip": {
861
+ "mode": "multi",
862
+ "sort": "desc"
863
+ }
864
+ },
865
+ "targets": [
866
+ {
867
+ "datasource": {
868
+ "type": "prometheus",
869
+ "uid": "${DS_PROMETHEUS}"
870
+ },
871
+ "editorMode": "code",
872
+ "expr": "app_process_resident_memory_bytes",
873
+ "legendFormat": "backend RSS",
874
+ "range": true,
875
+ "refId": "A"
876
+ }
877
+ ],
878
+ "title": "Backend Memory",
879
+ "type": "timeseries"
880
+ },
881
+ {
882
+ "datasource": {
883
+ "type": "prometheus",
884
+ "uid": "${DS_PROMETHEUS}"
885
+ },
886
+ "fieldConfig": {
887
+ "defaults": {
888
+ "mappings": [],
889
+ "thresholds": {
890
+ "mode": "absolute",
891
+ "steps": [
892
+ {
893
+ "color": "red",
894
+ "value": null
895
+ },
896
+ {
897
+ "color": "green",
898
+ "value": 1
899
+ }
900
+ ]
901
+ },
902
+ "unit": "none"
903
+ },
904
+ "overrides": []
905
+ },
906
+ "gridPos": {
907
+ "h": 7,
908
+ "w": 12,
909
+ "x": 12,
910
+ "y": 31
911
+ },
912
+ "id": 16,
913
+ "options": {
914
+ "displayMode": "lcd",
915
+ "maxVizHeight": 300,
916
+ "minVizHeight": 16,
917
+ "minVizWidth": 8,
918
+ "namePlacement": "auto",
919
+ "orientation": "horizontal",
920
+ "reduceOptions": {
921
+ "calcs": [
922
+ "lastNotNull"
923
+ ],
924
+ "fields": "",
925
+ "values": false
926
+ },
927
+ "showUnfilled": true,
928
+ "sizing": "auto",
929
+ "valueMode": "color"
930
+ },
931
+ "pluginVersion": "10.4.0",
932
+ "targets": [
933
+ {
934
+ "datasource": {
935
+ "type": "prometheus",
936
+ "uid": "${DS_PROMETHEUS}"
937
+ },
938
+ "editorMode": "code",
939
+ "expr": "up",
940
+ "legendFormat": "{{job}}",
941
+ "range": true,
942
+ "refId": "A"
943
+ }
944
+ ],
945
+ "title": "Prometheus Target Health",
946
+ "type": "bargauge"
947
+ }
948
+ ],
949
+ "refresh": "30s",
950
+ "schemaVersion": 39,
951
+ "style": "dark",
952
+ "tags": [
953
+ "pdf-assistant-rag",
954
+ "fastapi",
955
+ "prometheus",
956
+ "llm",
957
+ "rag"
958
+ ],
959
+ "templating": {
960
+ "list": [
961
+ {
962
+ "current": {
963
+ "selected": false,
964
+ "text": "Prometheus",
965
+ "value": "prometheus"
966
+ },
967
+ "hide": 0,
968
+ "includeAll": false,
969
+ "label": "Prometheus",
970
+ "multi": false,
971
+ "name": "DS_PROMETHEUS",
972
+ "options": [],
973
+ "query": "prometheus",
974
+ "refresh": 1,
975
+ "regex": "",
976
+ "type": "datasource"
977
+ },
978
+ {
979
+ "allValue": ".*",
980
+ "current": {
981
+ "selected": true,
982
+ "text": "All",
983
+ "value": "$__all"
984
+ },
985
+ "datasource": {
986
+ "type": "prometheus",
987
+ "uid": "${DS_PROMETHEUS}"
988
+ },
989
+ "definition": "label_values(http_requests_total, handler)",
990
+ "hide": 0,
991
+ "includeAll": true,
992
+ "label": "Route",
993
+ "multi": true,
994
+ "name": "handler",
995
+ "options": [],
996
+ "query": {
997
+ "query": "label_values(http_requests_total, handler)",
998
+ "refId": "PrometheusVariableQueryEditor-VariableQuery"
999
+ },
1000
+ "refresh": 2,
1001
+ "regex": "",
1002
+ "sort": 1,
1003
+ "type": "query"
1004
+ }
1005
+ ]
1006
+ },
1007
+ "time": {
1008
+ "from": "now-6h",
1009
+ "to": "now"
1010
+ },
1011
+ "timepicker": {
1012
+ "refresh_intervals": [
1013
+ "10s",
1014
+ "30s",
1015
+ "1m",
1016
+ "5m",
1017
+ "15m"
1018
+ ]
1019
+ },
1020
+ "timezone": "browser",
1021
+ "title": "PDF-Assistant-RAG System Monitoring",
1022
+ "uid": "pdf-assistant-rag-system-monitoring",
1023
+ "version": 1,
1024
+ "weekStart": ""
1025
+ }