You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Update workbook with grid layout and add deploy-workbook.bicep
- Updated token-usage-workbook.json with grid layout for graphs
- Added deploy-workbook.bicep for standalone workbook deployment to any RG
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
"query": "let gpt4o_input = 2.50;\r\nlet gpt4o_output = 10.00;\r\nlet gpt4o_mini_input = 0.15;\r\nlet gpt4o_mini_output = 0.60;\r\ncustomEvents\r\n| where name == 'LLM_Model_Token_Usage'\r\n| where timestamp > ago(7d)\r\n| extend model = tostring(customDimensions['model_deployment_name'])\r\n| extend input_tokens = toint(customDimensions['input_tokens'])\r\n| extend output_tokens = toint(customDimensions['output_tokens'])\r\n| summarize TotalInput = sum(input_tokens), TotalOutput = sum(output_tokens) by model\r\n| extend InputPrice = case(model has \"mini\", gpt4o_mini_input, gpt4o_input)\r\n| extend OutputPrice = case(model has \"mini\", gpt4o_mini_output, gpt4o_output)\r\n| extend InputCost = round(TotalInput * InputPrice / 1000000.0, 4)\r\n| extend OutputCost = round(TotalOutput * OutputPrice / 1000000.0, 4)\r\n| extend TotalCost = InputCost + OutputCost\r\n| project Model = model, TotalInput, TotalOutput, InputCost, OutputCost, TotalCost\r\n| order by TotalCost desc",
155
148
"size": 0,
156
149
"title": "Estimated Cost by Model",
157
-
"timeContext": {
158
-
"durationMs": 2592000000
159
-
},
160
150
"timeContextFromParameter": "TimeRange",
161
151
"queryType": 0,
162
152
"resourceType": "microsoft.insights/components",
@@ -178,9 +168,6 @@
178
168
"query": "customEvents\r\n| where name == 'LLM_Model_Token_Usage'\r\n| where timestamp > ago(7d)\r\n| extend model = tostring(customDimensions['model_deployment_name'])\r\n| extend input_tokens = toint(customDimensions['input_tokens'])\r\n| extend output_tokens = toint(customDimensions['output_tokens'])\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| summarize\r\n InputTokens = sum(input_tokens),\r\n OutputTokens = sum(output_tokens),\r\n TotalTokens = sum(total_tokens),\r\n Invocations = count()\r\n by Model = model\r\n| order by TotalTokens desc",
179
169
"size": 0,
180
170
"title": "Token Usage by Model",
181
-
"timeContext": {
182
-
"durationMs": 604800000
183
-
},
184
171
"timeContextFromParameter": "TimeRange",
185
172
"queryType": 0,
186
173
"resourceType": "microsoft.insights/components",
@@ -195,9 +182,6 @@
195
182
"query": "customEvents\r\n| where name == 'LLM_Agent_Token_Usage'\r\n| where timestamp > ago(7d)\r\n| extend agent = tostring(customDimensions['agent_name'])\r\n| extend model = tostring(customDimensions['model_deployment_name'])\r\n| extend input_tokens = toint(customDimensions['input_tokens'])\r\n| extend output_tokens = toint(customDimensions['output_tokens'])\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| summarize\r\n InputTokens = sum(input_tokens),\r\n OutputTokens = sum(output_tokens),\r\n TotalTokens = sum(total_tokens),\r\n Invocations = count()\r\n by Step = agent, Model = model\r\n| order by TotalTokens desc",
196
183
"size": 0,
197
184
"title": "Step-to-Model Token Mapping",
198
-
"timeContext": {
199
-
"durationMs": 604800000
200
-
},
201
185
"timeContextFromParameter": "TimeRange",
202
186
"queryType": 0,
203
187
"resourceType": "microsoft.insights/components",
@@ -212,9 +196,6 @@
212
196
"query": "customEvents\r\n| where name == 'LLM_Token_Usage_Summary'\r\n| where timestamp > ago(7d)\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| extend process_id = tostring(customDimensions['process_id'])\r\n| extend file_name = tostring(customDimensions['file_name'])\r\n| summarize TotalTokens = max(total_tokens) by process_id, file_name\r\n| order by TotalTokens desc\r\n| take 20",
213
197
"size": 0,
214
198
"title": "Top 20 Token Consumers by Document",
215
-
"timeContext": {
216
-
"durationMs": 604800000
217
-
},
218
199
"timeContextFromParameter": "TimeRange",
219
200
"queryType": 0,
220
201
"resourceType": "microsoft.insights/components",
@@ -229,9 +210,6 @@
229
210
"query": "customEvents\r\n| where name == 'LLM_Token_Usage_Summary'\r\n| where timestamp > ago(7d)\r\n| extend process_id = tostring(customDimensions['process_id'])\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| extend input_tokens = toint(customDimensions['total_input_tokens'])\r\n| extend output_tokens = toint(customDimensions['total_output_tokens'])\r\n| extend mime_type = tostring(customDimensions['file_mime_type'])\r\n| extend file_type = case(\r\n mime_type has \"pdf\", \"PDF\",\r\n mime_type has \"image\", \"Image\",\r\n mime_type has \"word\" or mime_type has \"docx\", \"Word\",\r\n mime_type has \"excel\" or mime_type has \"xlsx\", \"Excel\",\r\n mime_type has \"text\", \"Text\",\r\n \"Other\")\r\n| summarize input_tokens=max(input_tokens), output_tokens=max(output_tokens), total_tokens=max(total_tokens), file_type=take_any(file_type) by process_id\r\n| summarize\r\n Documents = count(),\r\n TotalInputTokens = sum(input_tokens),\r\n TotalOutputTokens = sum(output_tokens),\r\n TotalTokens = sum(total_tokens),\r\n AvgTokensPerDoc = round(avg(total_tokens), 0)\r\n by FileType = file_type\r\n| order by TotalTokens desc",
230
211
"size": 0,
231
212
"title": "Token Usage by File Type",
232
-
"timeContext": {
233
-
"durationMs": 604800000
234
-
},
235
213
"timeContextFromParameter": "TimeRange",
236
214
"queryType": 0,
237
215
"resourceType": "microsoft.insights/components",
@@ -253,9 +231,6 @@
253
231
"query": "customEvents\r\n| where name == 'LLM_Token_Usage_Summary'\r\n| where timestamp > ago(7d)\r\n| extend process_id = tostring(customDimensions['process_id'])\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| summarize total_tokens=max(total_tokens) by process_id\r\n| summarize\r\n p50 = percentile(total_tokens, 50),\r\n p90 = percentile(total_tokens, 90),\r\n p95 = percentile(total_tokens, 95),\r\n p99 = percentile(total_tokens, 99),\r\n Max = max(total_tokens)",
254
232
"size": 3,
255
233
"title": "Token Usage Percentiles Per Document",
256
-
"timeContext": {
257
-
"durationMs": 604800000
258
-
},
259
234
"timeContextFromParameter": "TimeRange",
260
235
"queryType": 0,
261
236
"resourceType": "microsoft.insights/components",
@@ -278,9 +253,6 @@
278
253
"query": "customEvents\r\n| where name == 'LLM_Token_Usage_Summary'\r\n| where timestamp > ago(7d)\r\n| extend process_id = tostring(customDimensions['process_id'])\r\n| extend total_tokens = toint(customDimensions['total_tokens'])\r\n| summarize total_tokens=max(total_tokens), timestamp=min(timestamp) by process_id\r\n| summarize\r\n DocumentsProcessed = count(),\r\n TotalTokens = sum(total_tokens),\r\n AvgTokensPerDoc = round(avg(total_tokens), 0),\r\n MaxTokensPerDoc = max(total_tokens)\r\n by Day = bin(timestamp, 1d)\r\n| order by Day desc",
279
254
"size": 0,
280
255
"title": "Daily Processing Volume with Token Usage",
0 commit comments