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.
- package/README.md +1 -1
- package/dist/agent.js +6 -2
- package/dist/context/error.d.ts +15 -0
- package/dist/context/error.js +17 -0
- package/dist/context/guard.d.ts +8 -0
- package/dist/context/guard.js +41 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +2 -0
- package/dist/core/metrics.d.ts +4 -1
- package/dist/core/metrics.js +32 -2
- package/dist/core/pricing.d.ts +2 -0
- package/dist/core/pricing.js +51 -15
- package/dist/core/spans.js +27 -2
- package/dist/core/tracer.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instrumentations/anthropic.js +25 -2
- package/dist/instrumentations/create.js +61 -3
- package/dist/instrumentations/gemini.js +12 -0
- package/dist/instrumentations/openai.js +20 -3
- package/dist/instrumentations/types.d.ts +9 -0
- package/dist/types/attributes.d.ts +1 -0
- package/dist/types/attributes.js +1 -0
- package/dist/types/config.d.ts +7 -0
- package/dist/types/metrics.d.ts +3 -0
- package/dist/types/metrics.js +4 -0
- package/dist/types/spans.d.ts +4 -0
- package/package.json +1 -1
- package/templates/grafana/dashboards/agent-workflow.json +154 -31
- package/templates/grafana/dashboards/cost-breakdown.json +168 -40
- package/templates/grafana/dashboards/error-drilldown.json +155 -37
- package/templates/grafana/dashboards/finops-attribution.json +192 -43
- package/templates/grafana/dashboards/latency-analysis.json +103 -24
- package/templates/grafana/dashboards/llm-overview.json +268 -66
- package/templates/grafana/dashboards/model-comparison.json +119 -26
- package/templates/grafana/dashboards/provider-health.json +137 -31
package/dist/types/metrics.js
CHANGED
|
@@ -15,6 +15,7 @@ export const GEN_AI_METRICS = {
|
|
|
15
15
|
// Agent metrics
|
|
16
16
|
AGENT_STEPS_PER_QUERY: "gen_ai.agent.steps_per_query",
|
|
17
17
|
AGENT_TOOL_USAGE: "gen_ai.agent.tool_usage",
|
|
18
|
+
AGENT_TOOL_DURATION: "gen_ai.agent.tool_duration",
|
|
18
19
|
// Guard metrics
|
|
19
20
|
GUARD_EVALUATIONS: "gen_ai.toad_eye.guard.evaluations",
|
|
20
21
|
GUARD_WOULD_BLOCK: "gen_ai.toad_eye.guard.would_block",
|
|
@@ -29,6 +30,9 @@ export const GEN_AI_METRICS = {
|
|
|
29
30
|
// Response quality proxy metrics
|
|
30
31
|
RESPONSE_EMPTY: "gen_ai.toad_eye.response.empty",
|
|
31
32
|
RESPONSE_LATENCY_PER_TOKEN: "gen_ai.toad_eye.response.latency_per_token",
|
|
33
|
+
// Context utilization
|
|
34
|
+
CONTEXT_UTILIZATION: "gen_ai.toad_eye.context_utilization",
|
|
35
|
+
CONTEXT_BLOCKED: "gen_ai.toad_eye.context.blocked",
|
|
32
36
|
};
|
|
33
37
|
/** @deprecated Use GEN_AI_METRICS instead. Kept for backward compatibility. */
|
|
34
38
|
export const LLM_METRICS = {
|
package/dist/types/spans.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export interface AgentStepInput {
|
|
|
11
11
|
readonly toolName?: string | undefined;
|
|
12
12
|
/** Tool type per OTel GenAI spec: function, extension, retrieval, builtin */
|
|
13
13
|
readonly toolType?: "function" | "extension" | "retrieval" | "builtin" | undefined;
|
|
14
|
+
/** Duration of tool execution in milliseconds (for act steps). */
|
|
15
|
+
readonly toolDurationMs?: number | undefined;
|
|
16
|
+
/** Whether the tool execution succeeded or failed (for act steps). */
|
|
17
|
+
readonly toolStatus?: "success" | "error" | undefined;
|
|
14
18
|
/** Target agent name for handoff steps */
|
|
15
19
|
readonly toAgent?: string | undefined;
|
|
16
20
|
/** Reason for handoff */
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"annotations": {
|
|
2
|
+
"annotations": {
|
|
3
|
+
"list": []
|
|
4
|
+
},
|
|
3
5
|
"editable": true,
|
|
4
6
|
"fiscalYearStartMonth": 0,
|
|
5
7
|
"graphTooltip": 1,
|
|
@@ -9,8 +11,16 @@
|
|
|
9
11
|
{
|
|
10
12
|
"title": "Avg Steps per Query",
|
|
11
13
|
"type": "stat",
|
|
12
|
-
"gridPos": {
|
|
13
|
-
|
|
14
|
+
"gridPos": {
|
|
15
|
+
"h": 4,
|
|
16
|
+
"w": 6,
|
|
17
|
+
"x": 0,
|
|
18
|
+
"y": 0
|
|
19
|
+
},
|
|
20
|
+
"datasource": {
|
|
21
|
+
"type": "prometheus",
|
|
22
|
+
"uid": "prometheus"
|
|
23
|
+
},
|
|
14
24
|
"targets": [
|
|
15
25
|
{
|
|
16
26
|
"expr": "sum(gen_ai_agent_steps_per_query_sum) / sum(gen_ai_agent_steps_per_query_count) or vector(0)",
|
|
@@ -23,9 +33,18 @@
|
|
|
23
33
|
"decimals": 1,
|
|
24
34
|
"thresholds": {
|
|
25
35
|
"steps": [
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
{
|
|
37
|
+
"color": "green",
|
|
38
|
+
"value": null
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"color": "yellow",
|
|
42
|
+
"value": 10
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"color": "red",
|
|
46
|
+
"value": 20
|
|
47
|
+
}
|
|
29
48
|
]
|
|
30
49
|
}
|
|
31
50
|
},
|
|
@@ -35,8 +54,16 @@
|
|
|
35
54
|
{
|
|
36
55
|
"title": "Total Agent Queries",
|
|
37
56
|
"type": "stat",
|
|
38
|
-
"gridPos": {
|
|
39
|
-
|
|
57
|
+
"gridPos": {
|
|
58
|
+
"h": 4,
|
|
59
|
+
"w": 6,
|
|
60
|
+
"x": 6,
|
|
61
|
+
"y": 0
|
|
62
|
+
},
|
|
63
|
+
"datasource": {
|
|
64
|
+
"type": "prometheus",
|
|
65
|
+
"uid": "prometheus"
|
|
66
|
+
},
|
|
40
67
|
"targets": [
|
|
41
68
|
{
|
|
42
69
|
"expr": "sum(gen_ai_agent_steps_per_query_count)",
|
|
@@ -44,15 +71,25 @@
|
|
|
44
71
|
}
|
|
45
72
|
],
|
|
46
73
|
"fieldConfig": {
|
|
47
|
-
"defaults": {
|
|
74
|
+
"defaults": {
|
|
75
|
+
"unit": "short"
|
|
76
|
+
},
|
|
48
77
|
"overrides": []
|
|
49
78
|
}
|
|
50
79
|
},
|
|
51
80
|
{
|
|
52
81
|
"title": "Total Tool Invocations",
|
|
53
82
|
"type": "stat",
|
|
54
|
-
"gridPos": {
|
|
55
|
-
|
|
83
|
+
"gridPos": {
|
|
84
|
+
"h": 4,
|
|
85
|
+
"w": 6,
|
|
86
|
+
"x": 12,
|
|
87
|
+
"y": 0
|
|
88
|
+
},
|
|
89
|
+
"datasource": {
|
|
90
|
+
"type": "prometheus",
|
|
91
|
+
"uid": "prometheus"
|
|
92
|
+
},
|
|
56
93
|
"targets": [
|
|
57
94
|
{
|
|
58
95
|
"expr": "sum(gen_ai_agent_tool_usage_total)",
|
|
@@ -60,15 +97,25 @@
|
|
|
60
97
|
}
|
|
61
98
|
],
|
|
62
99
|
"fieldConfig": {
|
|
63
|
-
"defaults": {
|
|
100
|
+
"defaults": {
|
|
101
|
+
"unit": "short"
|
|
102
|
+
},
|
|
64
103
|
"overrides": []
|
|
65
104
|
}
|
|
66
105
|
},
|
|
67
106
|
{
|
|
68
107
|
"title": "Unique Tools Used",
|
|
69
108
|
"type": "stat",
|
|
70
|
-
"gridPos": {
|
|
71
|
-
|
|
109
|
+
"gridPos": {
|
|
110
|
+
"h": 4,
|
|
111
|
+
"w": 6,
|
|
112
|
+
"x": 18,
|
|
113
|
+
"y": 0
|
|
114
|
+
},
|
|
115
|
+
"datasource": {
|
|
116
|
+
"type": "prometheus",
|
|
117
|
+
"uid": "prometheus"
|
|
118
|
+
},
|
|
72
119
|
"targets": [
|
|
73
120
|
{
|
|
74
121
|
"expr": "count(count by (gen_ai_agent_tool_name) (gen_ai_agent_tool_usage_total))",
|
|
@@ -76,7 +123,9 @@
|
|
|
76
123
|
}
|
|
77
124
|
],
|
|
78
125
|
"fieldConfig": {
|
|
79
|
-
"defaults": {
|
|
126
|
+
"defaults": {
|
|
127
|
+
"unit": "short"
|
|
128
|
+
},
|
|
80
129
|
"overrides": []
|
|
81
130
|
}
|
|
82
131
|
},
|
|
@@ -84,8 +133,16 @@
|
|
|
84
133
|
"title": "Agent Step Type Breakdown",
|
|
85
134
|
"description": "Distribution of think / act / observe / answer steps",
|
|
86
135
|
"type": "piechart",
|
|
87
|
-
"gridPos": {
|
|
88
|
-
|
|
136
|
+
"gridPos": {
|
|
137
|
+
"h": 8,
|
|
138
|
+
"w": 12,
|
|
139
|
+
"x": 0,
|
|
140
|
+
"y": 4
|
|
141
|
+
},
|
|
142
|
+
"datasource": {
|
|
143
|
+
"type": "prometheus",
|
|
144
|
+
"uid": "prometheus"
|
|
145
|
+
},
|
|
89
146
|
"targets": [
|
|
90
147
|
{
|
|
91
148
|
"expr": "sum by (gen_ai_agent_step_type) (gen_ai_agent_steps_per_query_sum)",
|
|
@@ -106,8 +163,16 @@
|
|
|
106
163
|
"title": "Tool Usage Frequency",
|
|
107
164
|
"description": "Invocations per tool name",
|
|
108
165
|
"type": "barchart",
|
|
109
|
-
"gridPos": {
|
|
110
|
-
|
|
166
|
+
"gridPos": {
|
|
167
|
+
"h": 8,
|
|
168
|
+
"w": 12,
|
|
169
|
+
"x": 12,
|
|
170
|
+
"y": 4
|
|
171
|
+
},
|
|
172
|
+
"datasource": {
|
|
173
|
+
"type": "prometheus",
|
|
174
|
+
"uid": "prometheus"
|
|
175
|
+
},
|
|
111
176
|
"targets": [
|
|
112
177
|
{
|
|
113
178
|
"expr": "sort_desc(sum by (gen_ai_agent_tool_name) (gen_ai_agent_tool_usage_total))",
|
|
@@ -119,8 +184,16 @@
|
|
|
119
184
|
{
|
|
120
185
|
"title": "Steps per Query Over Time",
|
|
121
186
|
"type": "timeseries",
|
|
122
|
-
"gridPos": {
|
|
123
|
-
|
|
187
|
+
"gridPos": {
|
|
188
|
+
"h": 8,
|
|
189
|
+
"w": 24,
|
|
190
|
+
"x": 0,
|
|
191
|
+
"y": 12
|
|
192
|
+
},
|
|
193
|
+
"datasource": {
|
|
194
|
+
"type": "prometheus",
|
|
195
|
+
"uid": "prometheus"
|
|
196
|
+
},
|
|
124
197
|
"targets": [
|
|
125
198
|
{
|
|
126
199
|
"expr": "sum(rate(gen_ai_agent_steps_per_query_sum[5m])) / sum(rate(gen_ai_agent_steps_per_query_count[5m]))",
|
|
@@ -136,7 +209,9 @@
|
|
|
136
209
|
"fieldConfig": {
|
|
137
210
|
"defaults": {
|
|
138
211
|
"unit": "short",
|
|
139
|
-
"custom": {
|
|
212
|
+
"custom": {
|
|
213
|
+
"fillOpacity": 10
|
|
214
|
+
}
|
|
140
215
|
},
|
|
141
216
|
"overrides": []
|
|
142
217
|
}
|
|
@@ -144,8 +219,16 @@
|
|
|
144
219
|
{
|
|
145
220
|
"title": "Tool Invocations Over Time",
|
|
146
221
|
"type": "timeseries",
|
|
147
|
-
"gridPos": {
|
|
148
|
-
|
|
222
|
+
"gridPos": {
|
|
223
|
+
"h": 8,
|
|
224
|
+
"w": 12,
|
|
225
|
+
"x": 0,
|
|
226
|
+
"y": 20
|
|
227
|
+
},
|
|
228
|
+
"datasource": {
|
|
229
|
+
"type": "prometheus",
|
|
230
|
+
"uid": "prometheus"
|
|
231
|
+
},
|
|
149
232
|
"targets": [
|
|
150
233
|
{
|
|
151
234
|
"expr": "sum by (gen_ai_agent_tool_name) (rate(gen_ai_agent_tool_usage_total[5m]))",
|
|
@@ -156,7 +239,12 @@
|
|
|
156
239
|
"fieldConfig": {
|
|
157
240
|
"defaults": {
|
|
158
241
|
"unit": "reqps",
|
|
159
|
-
"custom": {
|
|
242
|
+
"custom": {
|
|
243
|
+
"fillOpacity": 20,
|
|
244
|
+
"stacking": {
|
|
245
|
+
"mode": "normal"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
160
248
|
},
|
|
161
249
|
"overrides": []
|
|
162
250
|
}
|
|
@@ -165,8 +253,16 @@
|
|
|
165
253
|
"title": "Steps Distribution Histogram",
|
|
166
254
|
"description": "How many steps do agent queries typically take?",
|
|
167
255
|
"type": "histogram",
|
|
168
|
-
"gridPos": {
|
|
169
|
-
|
|
256
|
+
"gridPos": {
|
|
257
|
+
"h": 8,
|
|
258
|
+
"w": 12,
|
|
259
|
+
"x": 12,
|
|
260
|
+
"y": 20
|
|
261
|
+
},
|
|
262
|
+
"datasource": {
|
|
263
|
+
"type": "prometheus",
|
|
264
|
+
"uid": "prometheus"
|
|
265
|
+
},
|
|
170
266
|
"targets": [
|
|
171
267
|
{
|
|
172
268
|
"expr": "sum by (le) (gen_ai_agent_steps_per_query_bucket)",
|
|
@@ -176,7 +272,9 @@
|
|
|
176
272
|
],
|
|
177
273
|
"fieldConfig": {
|
|
178
274
|
"defaults": {
|
|
179
|
-
"custom": {
|
|
275
|
+
"custom": {
|
|
276
|
+
"fillOpacity": 80
|
|
277
|
+
}
|
|
180
278
|
},
|
|
181
279
|
"overrides": []
|
|
182
280
|
}
|
|
@@ -186,19 +284,44 @@
|
|
|
186
284
|
"tags": ["toad-eye", "agent"],
|
|
187
285
|
"templating": {
|
|
188
286
|
"list": [
|
|
287
|
+
{
|
|
288
|
+
"name": "service",
|
|
289
|
+
"type": "query",
|
|
290
|
+
"datasource": {
|
|
291
|
+
"type": "prometheus",
|
|
292
|
+
"uid": "prometheus"
|
|
293
|
+
},
|
|
294
|
+
"query": "label_values(gen_ai_client_requests_total, job)",
|
|
295
|
+
"includeAll": true,
|
|
296
|
+
"allValue": ".*",
|
|
297
|
+
"current": {
|
|
298
|
+
"text": "All",
|
|
299
|
+
"value": "$__all"
|
|
300
|
+
},
|
|
301
|
+
"multi": true
|
|
302
|
+
},
|
|
189
303
|
{
|
|
190
304
|
"name": "tool",
|
|
191
305
|
"type": "query",
|
|
192
|
-
"datasource": {
|
|
306
|
+
"datasource": {
|
|
307
|
+
"type": "prometheus",
|
|
308
|
+
"uid": "prometheus"
|
|
309
|
+
},
|
|
193
310
|
"query": "label_values(gen_ai_agent_tool_usage_total, gen_ai_agent_tool_name)",
|
|
194
311
|
"includeAll": true,
|
|
195
312
|
"multi": true,
|
|
196
|
-
"current": {
|
|
313
|
+
"current": {
|
|
314
|
+
"text": "All",
|
|
315
|
+
"value": "$__all"
|
|
316
|
+
},
|
|
197
317
|
"regex": ""
|
|
198
318
|
}
|
|
199
319
|
]
|
|
200
320
|
},
|
|
201
|
-
"time": {
|
|
321
|
+
"time": {
|
|
322
|
+
"from": "now-6h",
|
|
323
|
+
"to": "now"
|
|
324
|
+
},
|
|
202
325
|
"timepicker": {},
|
|
203
326
|
"timezone": "utc",
|
|
204
327
|
"title": "toad-eye / Agent Workflow",
|