toad-eye 2.4.4 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/dist/agent.js +6 -2
  3. package/dist/context/error.d.ts +15 -0
  4. package/dist/context/error.js +17 -0
  5. package/dist/context/guard.d.ts +8 -0
  6. package/dist/context/guard.js +41 -0
  7. package/dist/context/index.d.ts +2 -0
  8. package/dist/context/index.js +2 -0
  9. package/dist/core/metrics.d.ts +4 -1
  10. package/dist/core/metrics.js +32 -2
  11. package/dist/core/pricing.d.ts +2 -0
  12. package/dist/core/pricing.js +51 -15
  13. package/dist/core/spans.js +27 -2
  14. package/dist/core/tracer.js +2 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.js +1 -0
  17. package/dist/instrumentations/anthropic.js +25 -2
  18. package/dist/instrumentations/create.js +61 -3
  19. package/dist/instrumentations/gemini.js +12 -0
  20. package/dist/instrumentations/openai.js +20 -3
  21. package/dist/instrumentations/types.d.ts +9 -0
  22. package/dist/types/attributes.d.ts +1 -0
  23. package/dist/types/attributes.js +1 -0
  24. package/dist/types/config.d.ts +7 -0
  25. package/dist/types/metrics.d.ts +3 -0
  26. package/dist/types/metrics.js +4 -0
  27. package/dist/types/spans.d.ts +4 -0
  28. package/package.json +1 -1
  29. package/templates/grafana/dashboards/agent-workflow.json +154 -31
  30. package/templates/grafana/dashboards/cost-breakdown.json +168 -40
  31. package/templates/grafana/dashboards/error-drilldown.json +155 -37
  32. package/templates/grafana/dashboards/finops-attribution.json +192 -43
  33. package/templates/grafana/dashboards/latency-analysis.json +103 -24
  34. package/templates/grafana/dashboards/llm-overview.json +268 -66
  35. package/templates/grafana/dashboards/model-comparison.json +119 -26
  36. package/templates/grafana/dashboards/provider-health.json +137 -31
@@ -1,5 +1,7 @@
1
1
  {
2
- "annotations": { "list": [] },
2
+ "annotations": {
3
+ "list": []
4
+ },
3
5
  "editable": true,
4
6
  "fiscalYearStartMonth": 0,
5
7
  "graphTooltip": 1,
@@ -9,11 +11,19 @@
9
11
  {
10
12
  "title": "Total Cost",
11
13
  "type": "stat",
12
- "gridPos": { "h": 4, "w": 8, "x": 0, "y": 0 },
13
- "datasource": { "type": "prometheus", "uid": "prometheus" },
14
+ "gridPos": {
15
+ "h": 4,
16
+ "w": 8,
17
+ "x": 0,
18
+ "y": 0
19
+ },
20
+ "datasource": {
21
+ "type": "prometheus",
22
+ "uid": "prometheus"
23
+ },
14
24
  "targets": [
15
25
  {
16
- "expr": "sum(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"})",
26
+ "expr": "sum(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"})",
17
27
  "refId": "A"
18
28
  }
19
29
  ],
@@ -22,9 +32,18 @@
22
32
  "unit": "currencyUSD",
23
33
  "thresholds": {
24
34
  "steps": [
25
- { "color": "green", "value": null },
26
- { "color": "yellow", "value": 50 },
27
- { "color": "red", "value": 500 }
35
+ {
36
+ "color": "green",
37
+ "value": null
38
+ },
39
+ {
40
+ "color": "yellow",
41
+ "value": 50
42
+ },
43
+ {
44
+ "color": "red",
45
+ "value": 500
46
+ }
28
47
  ]
29
48
  }
30
49
  },
@@ -34,11 +53,19 @@
34
53
  {
35
54
  "title": "Cost Today",
36
55
  "type": "stat",
37
- "gridPos": { "h": 4, "w": 8, "x": 8, "y": 0 },
38
- "datasource": { "type": "prometheus", "uid": "prometheus" },
56
+ "gridPos": {
57
+ "h": 4,
58
+ "w": 8,
59
+ "x": 8,
60
+ "y": 0
61
+ },
62
+ "datasource": {
63
+ "type": "prometheus",
64
+ "uid": "prometheus"
65
+ },
39
66
  "targets": [
40
67
  {
41
- "expr": "sum(increase(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1d]))",
68
+ "expr": "sum(increase(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1d]))",
42
69
  "refId": "A"
43
70
  }
44
71
  ],
@@ -47,9 +74,18 @@
47
74
  "unit": "currencyUSD",
48
75
  "thresholds": {
49
76
  "steps": [
50
- { "color": "green", "value": null },
51
- { "color": "yellow", "value": 10 },
52
- { "color": "red", "value": 50 }
77
+ {
78
+ "color": "green",
79
+ "value": null
80
+ },
81
+ {
82
+ "color": "yellow",
83
+ "value": 10
84
+ },
85
+ {
86
+ "color": "red",
87
+ "value": 50
88
+ }
53
89
  ]
54
90
  }
55
91
  },
@@ -59,11 +95,19 @@
59
95
  {
60
96
  "title": "Projected Monthly Cost",
61
97
  "type": "stat",
62
- "gridPos": { "h": 4, "w": 8, "x": 16, "y": 0 },
63
- "datasource": { "type": "prometheus", "uid": "prometheus" },
98
+ "gridPos": {
99
+ "h": 4,
100
+ "w": 8,
101
+ "x": 16,
102
+ "y": 0
103
+ },
104
+ "datasource": {
105
+ "type": "prometheus",
106
+ "uid": "prometheus"
107
+ },
64
108
  "targets": [
65
109
  {
66
- "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1d])) * 86400 * 30",
110
+ "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1d])) * 86400 * 30",
67
111
  "refId": "A"
68
112
  }
69
113
  ],
@@ -72,9 +116,18 @@
72
116
  "unit": "currencyUSD",
73
117
  "thresholds": {
74
118
  "steps": [
75
- { "color": "green", "value": null },
76
- { "color": "yellow", "value": 100 },
77
- { "color": "red", "value": 1000 }
119
+ {
120
+ "color": "green",
121
+ "value": null
122
+ },
123
+ {
124
+ "color": "yellow",
125
+ "value": 100
126
+ },
127
+ {
128
+ "color": "red",
129
+ "value": 1000
130
+ }
78
131
  ]
79
132
  }
80
133
  },
@@ -84,11 +137,19 @@
84
137
  {
85
138
  "title": "Cost by Provider",
86
139
  "type": "timeseries",
87
- "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
88
- "datasource": { "type": "prometheus", "uid": "prometheus" },
140
+ "gridPos": {
141
+ "h": 8,
142
+ "w": 12,
143
+ "x": 0,
144
+ "y": 4
145
+ },
146
+ "datasource": {
147
+ "type": "prometheus",
148
+ "uid": "prometheus"
149
+ },
89
150
  "targets": [
90
151
  {
91
- "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_provider_name) * 60",
152
+ "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_provider_name) * 60",
92
153
  "legendFormat": "{{ gen_ai_provider_name }}",
93
154
  "refId": "A"
94
155
  }
@@ -100,7 +161,9 @@
100
161
  "drawStyle": "bars",
101
162
  "fillOpacity": 50,
102
163
  "lineWidth": 1,
103
- "stacking": { "mode": "normal" }
164
+ "stacking": {
165
+ "mode": "normal"
166
+ }
104
167
  }
105
168
  },
106
169
  "overrides": []
@@ -109,11 +172,19 @@
109
172
  {
110
173
  "title": "Cost by Model",
111
174
  "type": "timeseries",
112
- "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
113
- "datasource": { "type": "prometheus", "uid": "prometheus" },
175
+ "gridPos": {
176
+ "h": 8,
177
+ "w": 12,
178
+ "x": 12,
179
+ "y": 4
180
+ },
181
+ "datasource": {
182
+ "type": "prometheus",
183
+ "uid": "prometheus"
184
+ },
114
185
  "targets": [
115
186
  {
116
- "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_request_model) * 60",
187
+ "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_request_model) * 60",
117
188
  "legendFormat": "{{ gen_ai_request_model }}",
118
189
  "refId": "A"
119
190
  }
@@ -125,7 +196,9 @@
125
196
  "drawStyle": "bars",
126
197
  "fillOpacity": 50,
127
198
  "lineWidth": 1,
128
- "stacking": { "mode": "normal" }
199
+ "stacking": {
200
+ "mode": "normal"
201
+ }
129
202
  }
130
203
  },
131
204
  "overrides": []
@@ -134,11 +207,19 @@
134
207
  {
135
208
  "title": "Cost per Request",
136
209
  "type": "timeseries",
137
- "gridPos": { "h": 8, "w": 12, "x": 0, "y": 12 },
138
- "datasource": { "type": "prometheus", "uid": "prometheus" },
210
+ "gridPos": {
211
+ "h": 8,
212
+ "w": 12,
213
+ "x": 0,
214
+ "y": 12
215
+ },
216
+ "datasource": {
217
+ "type": "prometheus",
218
+ "uid": "prometheus"
219
+ },
139
220
  "targets": [
140
221
  {
141
- "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[5m])) / sum(rate(gen_ai_client_request_cost_USD_count{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[5m]))",
222
+ "expr": "sum(rate(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[5m])) / sum(rate(gen_ai_client_request_cost_USD_count{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[5m]))",
142
223
  "legendFormat": "avg cost/request",
143
224
  "refId": "A"
144
225
  }
@@ -146,7 +227,11 @@
146
227
  "fieldConfig": {
147
228
  "defaults": {
148
229
  "unit": "currencyUSD",
149
- "custom": { "drawStyle": "line", "fillOpacity": 15, "lineWidth": 2 }
230
+ "custom": {
231
+ "drawStyle": "line",
232
+ "fillOpacity": 15,
233
+ "lineWidth": 2
234
+ }
150
235
  },
151
236
  "overrides": []
152
237
  }
@@ -154,11 +239,19 @@
154
239
  {
155
240
  "title": "Daily Cost Trend",
156
241
  "type": "timeseries",
157
- "gridPos": { "h": 8, "w": 12, "x": 12, "y": 12 },
158
- "datasource": { "type": "prometheus", "uid": "prometheus" },
242
+ "gridPos": {
243
+ "h": 8,
244
+ "w": 12,
245
+ "x": 12,
246
+ "y": 12
247
+ },
248
+ "datasource": {
249
+ "type": "prometheus",
250
+ "uid": "prometheus"
251
+ },
159
252
  "targets": [
160
253
  {
161
- "expr": "sum(increase(gen_ai_client_request_cost_USD_sum{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1h]))",
254
+ "expr": "sum(increase(gen_ai_client_request_cost_USD_sum{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1h]))",
162
255
  "legendFormat": "hourly cost",
163
256
  "refId": "A"
164
257
  }
@@ -166,7 +259,11 @@
166
259
  "fieldConfig": {
167
260
  "defaults": {
168
261
  "unit": "currencyUSD",
169
- "custom": { "drawStyle": "line", "fillOpacity": 15, "lineWidth": 2 }
262
+ "custom": {
263
+ "drawStyle": "line",
264
+ "fillOpacity": 15,
265
+ "lineWidth": 2
266
+ }
170
267
  },
171
268
  "overrides": []
172
269
  }
@@ -177,29 +274,60 @@
177
274
  "tags": ["llm", "observability", "toad-eye"],
178
275
  "templating": {
179
276
  "list": [
277
+ {
278
+ "name": "service",
279
+ "type": "query",
280
+ "datasource": {
281
+ "type": "prometheus",
282
+ "uid": "prometheus"
283
+ },
284
+ "query": "label_values(gen_ai_client_requests_total, job)",
285
+ "includeAll": true,
286
+ "allValue": ".*",
287
+ "current": {
288
+ "text": "All",
289
+ "value": "$__all"
290
+ },
291
+ "multi": true
292
+ },
180
293
  {
181
294
  "name": "provider",
182
295
  "type": "query",
183
- "datasource": { "type": "prometheus", "uid": "prometheus" },
296
+ "datasource": {
297
+ "type": "prometheus",
298
+ "uid": "prometheus"
299
+ },
184
300
  "query": "label_values(gen_ai_client_requests_total, gen_ai_provider_name)",
185
301
  "includeAll": true,
186
302
  "allValue": ".*",
187
- "current": { "text": "All", "value": "$__all" },
303
+ "current": {
304
+ "text": "All",
305
+ "value": "$__all"
306
+ },
188
307
  "multi": true
189
308
  },
190
309
  {
191
310
  "name": "model",
192
311
  "type": "query",
193
- "datasource": { "type": "prometheus", "uid": "prometheus" },
312
+ "datasource": {
313
+ "type": "prometheus",
314
+ "uid": "prometheus"
315
+ },
194
316
  "query": "label_values(gen_ai_client_requests_total{gen_ai_provider_name=~\"$provider\"}, gen_ai_request_model)",
195
317
  "includeAll": true,
196
318
  "allValue": ".*",
197
- "current": { "text": "All", "value": "$__all" },
319
+ "current": {
320
+ "text": "All",
321
+ "value": "$__all"
322
+ },
198
323
  "multi": true
199
324
  }
200
325
  ]
201
326
  },
202
- "time": { "from": "now-15m", "to": "now" },
327
+ "time": {
328
+ "from": "now-15m",
329
+ "to": "now"
330
+ },
203
331
  "timepicker": {},
204
332
  "timezone": "browser",
205
333
  "title": "toad-eye: Cost Breakdown",
@@ -1,5 +1,7 @@
1
1
  {
2
- "annotations": { "list": [] },
2
+ "annotations": {
3
+ "list": []
4
+ },
3
5
  "editable": true,
4
6
  "fiscalYearStartMonth": 0,
5
7
  "graphTooltip": 1,
@@ -9,11 +11,19 @@
9
11
  {
10
12
  "title": "Total Errors",
11
13
  "type": "stat",
12
- "gridPos": { "h": 4, "w": 8, "x": 0, "y": 0 },
13
- "datasource": { "type": "prometheus", "uid": "prometheus" },
14
+ "gridPos": {
15
+ "h": 4,
16
+ "w": 8,
17
+ "x": 0,
18
+ "y": 0
19
+ },
20
+ "datasource": {
21
+ "type": "prometheus",
22
+ "uid": "prometheus"
23
+ },
14
24
  "targets": [
15
25
  {
16
- "expr": "sum(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"})",
26
+ "expr": "sum(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"})",
17
27
  "refId": "A"
18
28
  }
19
29
  ],
@@ -22,9 +32,18 @@
22
32
  "unit": "short",
23
33
  "thresholds": {
24
34
  "steps": [
25
- { "color": "green", "value": null },
26
- { "color": "yellow", "value": 10 },
27
- { "color": "red", "value": 100 }
35
+ {
36
+ "color": "green",
37
+ "value": null
38
+ },
39
+ {
40
+ "color": "yellow",
41
+ "value": 10
42
+ },
43
+ {
44
+ "color": "red",
45
+ "value": 100
46
+ }
28
47
  ]
29
48
  }
30
49
  },
@@ -34,11 +53,19 @@
34
53
  {
35
54
  "title": "Error Rate %",
36
55
  "type": "stat",
37
- "gridPos": { "h": 4, "w": 8, "x": 8, "y": 0 },
38
- "datasource": { "type": "prometheus", "uid": "prometheus" },
56
+ "gridPos": {
57
+ "h": 4,
58
+ "w": 8,
59
+ "x": 8,
60
+ "y": 0
61
+ },
62
+ "datasource": {
63
+ "type": "prometheus",
64
+ "uid": "prometheus"
65
+ },
39
66
  "targets": [
40
67
  {
41
- "expr": "sum(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}) / sum(gen_ai_client_requests_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}) * 100",
68
+ "expr": "sum(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}) / sum(gen_ai_client_requests_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}) * 100",
42
69
  "refId": "A"
43
70
  }
44
71
  ],
@@ -47,9 +74,18 @@
47
74
  "unit": "percent",
48
75
  "thresholds": {
49
76
  "steps": [
50
- { "color": "green", "value": null },
51
- { "color": "yellow", "value": 5 },
52
- { "color": "red", "value": 20 }
77
+ {
78
+ "color": "green",
79
+ "value": null
80
+ },
81
+ {
82
+ "color": "yellow",
83
+ "value": 5
84
+ },
85
+ {
86
+ "color": "red",
87
+ "value": 20
88
+ }
53
89
  ]
54
90
  }
55
91
  },
@@ -59,11 +95,19 @@
59
95
  {
60
96
  "title": "Errors Last Hour",
61
97
  "type": "stat",
62
- "gridPos": { "h": 4, "w": 8, "x": 16, "y": 0 },
63
- "datasource": { "type": "prometheus", "uid": "prometheus" },
98
+ "gridPos": {
99
+ "h": 4,
100
+ "w": 8,
101
+ "x": 16,
102
+ "y": 0
103
+ },
104
+ "datasource": {
105
+ "type": "prometheus",
106
+ "uid": "prometheus"
107
+ },
64
108
  "targets": [
65
109
  {
66
- "expr": "sum(increase(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1h]))",
110
+ "expr": "sum(increase(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1h]))",
67
111
  "refId": "A"
68
112
  }
69
113
  ],
@@ -72,9 +116,18 @@
72
116
  "unit": "short",
73
117
  "thresholds": {
74
118
  "steps": [
75
- { "color": "green", "value": null },
76
- { "color": "yellow", "value": 5 },
77
- { "color": "red", "value": 50 }
119
+ {
120
+ "color": "green",
121
+ "value": null
122
+ },
123
+ {
124
+ "color": "yellow",
125
+ "value": 5
126
+ },
127
+ {
128
+ "color": "red",
129
+ "value": 50
130
+ }
78
131
  ]
79
132
  }
80
133
  },
@@ -84,11 +137,19 @@
84
137
  {
85
138
  "title": "Error Rate by Provider",
86
139
  "type": "timeseries",
87
- "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
88
- "datasource": { "type": "prometheus", "uid": "prometheus" },
140
+ "gridPos": {
141
+ "h": 8,
142
+ "w": 12,
143
+ "x": 0,
144
+ "y": 4
145
+ },
146
+ "datasource": {
147
+ "type": "prometheus",
148
+ "uid": "prometheus"
149
+ },
89
150
  "targets": [
90
151
  {
91
- "expr": "sum(rate(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_provider_name) * 60",
152
+ "expr": "sum(rate(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_provider_name) * 60",
92
153
  "legendFormat": "{{ gen_ai_provider_name }}",
93
154
  "refId": "A"
94
155
  }
@@ -96,7 +157,11 @@
96
157
  "fieldConfig": {
97
158
  "defaults": {
98
159
  "unit": "reqpm",
99
- "custom": { "drawStyle": "line", "fillOpacity": 15, "lineWidth": 2 }
160
+ "custom": {
161
+ "drawStyle": "line",
162
+ "fillOpacity": 15,
163
+ "lineWidth": 2
164
+ }
100
165
  },
101
166
  "overrides": []
102
167
  }
@@ -104,11 +169,19 @@
104
169
  {
105
170
  "title": "Error Rate by Model",
106
171
  "type": "timeseries",
107
- "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
108
- "datasource": { "type": "prometheus", "uid": "prometheus" },
172
+ "gridPos": {
173
+ "h": 8,
174
+ "w": 12,
175
+ "x": 12,
176
+ "y": 4
177
+ },
178
+ "datasource": {
179
+ "type": "prometheus",
180
+ "uid": "prometheus"
181
+ },
109
182
  "targets": [
110
183
  {
111
- "expr": "sum(rate(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_request_model) * 60",
184
+ "expr": "sum(rate(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) by (gen_ai_request_model) * 60",
112
185
  "legendFormat": "{{ gen_ai_request_model }}",
113
186
  "refId": "A"
114
187
  }
@@ -116,7 +189,11 @@
116
189
  "fieldConfig": {
117
190
  "defaults": {
118
191
  "unit": "reqpm",
119
- "custom": { "drawStyle": "line", "fillOpacity": 15, "lineWidth": 2 }
192
+ "custom": {
193
+ "drawStyle": "line",
194
+ "fillOpacity": 15,
195
+ "lineWidth": 2
196
+ }
120
197
  },
121
198
  "overrides": []
122
199
  }
@@ -124,16 +201,24 @@
124
201
  {
125
202
  "title": "Error vs Success Rate",
126
203
  "type": "timeseries",
127
- "gridPos": { "h": 8, "w": 24, "x": 0, "y": 12 },
128
- "datasource": { "type": "prometheus", "uid": "prometheus" },
204
+ "gridPos": {
205
+ "h": 8,
206
+ "w": 24,
207
+ "x": 0,
208
+ "y": 12
209
+ },
210
+ "datasource": {
211
+ "type": "prometheus",
212
+ "uid": "prometheus"
213
+ },
129
214
  "targets": [
130
215
  {
131
- "expr": "sum(rate(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) * 60",
216
+ "expr": "sum(rate(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) * 60",
132
217
  "legendFormat": "errors/min",
133
218
  "refId": "A"
134
219
  },
135
220
  {
136
- "expr": "(sum(rate(gen_ai_client_requests_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) - sum(rate(gen_ai_client_errors_total{gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m]))) * 60",
221
+ "expr": "(sum(rate(gen_ai_client_requests_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m])) - sum(rate(gen_ai_client_errors_total{job=~\"$service\", gen_ai_provider_name=~\"$provider\", gen_ai_request_model=~\"$model\"}[1m]))) * 60",
137
222
  "legendFormat": "success/min",
138
223
  "refId": "B"
139
224
  }
@@ -145,7 +230,9 @@
145
230
  "drawStyle": "line",
146
231
  "fillOpacity": 15,
147
232
  "lineWidth": 2,
148
- "stacking": { "mode": "normal" }
233
+ "stacking": {
234
+ "mode": "normal"
235
+ }
149
236
  }
150
237
  },
151
238
  "overrides": []
@@ -157,29 +244,60 @@
157
244
  "tags": ["llm", "observability", "toad-eye"],
158
245
  "templating": {
159
246
  "list": [
247
+ {
248
+ "name": "service",
249
+ "type": "query",
250
+ "datasource": {
251
+ "type": "prometheus",
252
+ "uid": "prometheus"
253
+ },
254
+ "query": "label_values(gen_ai_client_requests_total, job)",
255
+ "includeAll": true,
256
+ "allValue": ".*",
257
+ "current": {
258
+ "text": "All",
259
+ "value": "$__all"
260
+ },
261
+ "multi": true
262
+ },
160
263
  {
161
264
  "name": "provider",
162
265
  "type": "query",
163
- "datasource": { "type": "prometheus", "uid": "prometheus" },
266
+ "datasource": {
267
+ "type": "prometheus",
268
+ "uid": "prometheus"
269
+ },
164
270
  "query": "label_values(gen_ai_client_requests_total, gen_ai_provider_name)",
165
271
  "includeAll": true,
166
272
  "allValue": ".*",
167
- "current": { "text": "All", "value": "$__all" },
273
+ "current": {
274
+ "text": "All",
275
+ "value": "$__all"
276
+ },
168
277
  "multi": true
169
278
  },
170
279
  {
171
280
  "name": "model",
172
281
  "type": "query",
173
- "datasource": { "type": "prometheus", "uid": "prometheus" },
282
+ "datasource": {
283
+ "type": "prometheus",
284
+ "uid": "prometheus"
285
+ },
174
286
  "query": "label_values(gen_ai_client_requests_total{gen_ai_provider_name=~\"$provider\"}, gen_ai_request_model)",
175
287
  "includeAll": true,
176
288
  "allValue": ".*",
177
- "current": { "text": "All", "value": "$__all" },
289
+ "current": {
290
+ "text": "All",
291
+ "value": "$__all"
292
+ },
178
293
  "multi": true
179
294
  }
180
295
  ]
181
296
  },
182
- "time": { "from": "now-15m", "to": "now" },
297
+ "time": {
298
+ "from": "now-15m",
299
+ "to": "now"
300
+ },
183
301
  "timepicker": {},
184
302
  "timezone": "browser",
185
303
  "title": "toad-eye: Error Drill-down",