File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
agents-run-api/src/handlers Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @inkeep/agents-run-api " : patch
3+ " @inkeep/agents-cli " : patch
4+ " @inkeep/agents-manage-api " : patch
5+ " @inkeep/agents-manage-ui " : patch
6+ " @inkeep/agents-core " : patch
7+ " @inkeep/agents-manage-mcp " : patch
8+ " @inkeep/agents-sdk " : patch
9+ " @inkeep/ai-sdk-provider " : patch
10+ " @inkeep/create-agents " : patch
11+ ---
12+
13+ batch flushing
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { executeTransfer } from '../a2a/transfer.js';
1818import { extractTransferData , isTransferTask } from '../a2a/types.js' ;
1919import { AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS } from '../constants/execution-limits' ;
2020import dbClient from '../data/db/dbClient.js' ;
21+ import { flushBatchProcessor } from '../instrumentation.js' ;
2122import { getLogger } from '../logger.js' ;
2223import { agentSessionManager } from '../services/AgentSession.js' ;
2324import { agentInitializingOp , completionOp , errorOp } from '../utils/agent-operations.js' ;
@@ -520,6 +521,10 @@ export class ExecutionHandler {
520521 throw error ;
521522 } finally {
522523 span . end ( ) ;
524+ // Flush immediately after span ends to ensure it's sent to SignOz
525+ // Use setImmediate to allow span to be processed before flushing
526+ await new Promise ( ( resolve ) => setImmediate ( resolve ) ) ;
527+ await flushBatchProcessor ( ) ;
523528 }
524529 } ) ;
525530 }
You can’t perform that action at this time.
0 commit comments