File tree Expand file tree Collapse file tree
app/workspace/[workspaceId]/logs
lib/logs/execution/trace-spans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -477,6 +477,10 @@ export default function Logs() {
477477 activeLogTabRef . current = 'overview'
478478 } , [ ] )
479479
480+ const handleActiveTabChange = useCallback ( ( tab : string ) => {
481+ activeLogTabRef . current = tab
482+ } , [ ] )
483+
480484 const handleLogContextMenu = useCallback (
481485 ( e : React . MouseEvent , rowId : string ) => {
482486 e . preventDefault ( )
@@ -815,9 +819,7 @@ export default function Logs() {
815819 hasPrev = { selectedLogIndex > 0 }
816820 onRetryExecution = { handleRetrySidebarExecution }
817821 isRetryPending = { retryExecution . isPending }
818- onActiveTabChange = { ( tab ) => {
819- activeLogTabRef . current = tab
820- } }
822+ onActiveTabChange = { handleActiveTabChange }
821823 />
822824 )
823825
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ function wrapInWorkflowRoot(
9696 const actualWorkflowDuration = latestEnd - earliestStart
9797 addRelativeTimestamps ( grouped , earliestStart )
9898
99+ const totalCost = leafSpans . reduce ( ( sum , s ) => sum + ( s . cost ?. total ?? 0 ) , 0 )
100+
99101 const workflowSpan : TraceSpan = {
100102 id : 'workflow-execution' ,
101103 name : 'Workflow Execution' ,
@@ -105,6 +107,7 @@ function wrapInWorkflowRoot(
105107 endTime : new Date ( latestEnd ) . toISOString ( ) ,
106108 status : grouped . some ( hasUnhandledError ) ? 'error' : 'success' ,
107109 children : grouped ,
110+ ...( totalCost > 0 && { cost : { total : totalCost } } ) ,
108111 }
109112
110113 return { traceSpans : [ workflowSpan ] , totalDuration : actualWorkflowDuration }
You can’t perform that action at this time.
0 commit comments