@@ -293,7 +293,66 @@ customEvents
293293 by process_id, Step = agent
294294| order by process_id, TotalTokens desc
295295
296- // 18. Daily processing volume with token costs
296+ // 18. Processing time per pipeline step
297+ traces
298+ | where timestamp > ago (7 d )
299+ | where message has "Pipeline stage completed"
300+ | parse message with * "process_id=" process_id ", document=" document ", stage=" stage ", elapsed=" elapsed
301+ | where isnotempty (stage)
302+ | extend elapsed_parts = split (elapsed, ":" )
303+ | extend hours = toint (elapsed_parts[0 ])
304+ | extend mins = toint (elapsed_parts[1 ])
305+ | extend sec_parts = split (tostring (elapsed_parts[2 ]), "." )
306+ | extend secs = toint (sec_parts[0 ])
307+ | extend ms = toint (sec_parts[1 ])
308+ | extend elapsed_seconds = hours * 3600.0 + mins * 60.0 + secs + ms / 100.0
309+ | summarize
310+ AvgSeconds = round (avg (elapsed_seconds), 2 ),
311+ P50Seconds = round (percentile(elapsed_seconds, 50 ), 2 ),
312+ P90Seconds = round (percentile(elapsed_seconds, 90 ), 2 ),
313+ MaxSeconds = round (max (elapsed_seconds), 2 ),
314+ Invocations = count ()
315+ by Step = stage
316+ | order by AvgSeconds desc
317+
318+ // 19. Total document processing time (end-to-end workflow)
319+ traces
320+ | where timestamp > ago (7 d )
321+ | where message has "Workflow elapsed time"
322+ | parse message with * "Workflow elapsed time: " elapsed " (start=" * ", end=" *
323+ | where isnotempty (elapsed)
324+ | extend elapsed_parts = split (elapsed, ":" )
325+ | extend hours = toint (elapsed_parts[0 ])
326+ | extend mins = toint (elapsed_parts[1 ])
327+ | extend sec_parts = split (tostring (elapsed_parts[2 ]), "." )
328+ | extend secs = toint (sec_parts[0 ])
329+ | extend ms = toint (sec_parts[1 ])
330+ | extend elapsed_seconds = hours * 3600.0 + mins * 60.0 + secs + ms / 100.0
331+ | summarize
332+ DocumentsProcessed = count (),
333+ AvgSeconds = round (avg (elapsed_seconds), 2 ),
334+ P50Seconds = round (percentile(elapsed_seconds, 50 ), 2 ),
335+ P90Seconds = round (percentile(elapsed_seconds, 90 ), 2 ),
336+ P95Seconds = round (percentile(elapsed_seconds, 95 ), 2 ),
337+ MaxSeconds = round (max (elapsed_seconds), 2 )
338+
339+ // 20. Per-document processing time breakdown by step
340+ traces
341+ | where timestamp > ago (7 d )
342+ | where message has "Pipeline stage completed"
343+ | parse message with * "process_id=" process_id ", document=" document ", stage=" stage ", elapsed=" elapsed
344+ | where isnotempty (stage)
345+ | extend elapsed_parts = split (elapsed, ":" )
346+ | extend hours = toint (elapsed_parts[0 ])
347+ | extend mins = toint (elapsed_parts[1 ])
348+ | extend sec_parts = split (tostring (elapsed_parts[2 ]), "." )
349+ | extend secs = toint (sec_parts[0 ])
350+ | extend ms = toint (sec_parts[1 ])
351+ | extend elapsed_seconds = round (hours * 3600.0 + mins * 60.0 + secs + ms / 100.0 , 2 )
352+ | project timestamp, process_id, document, Step=stage, ElapsedSeconds=elapsed_seconds
353+ | order by process_id, timestamp asc
354+
355+ // 21. Daily processing volume with token costs
297356customEvents
298357| where name == 'LLM_Agent_Token_Usage'
299358| where timestamp > ago (30 d )
0 commit comments