@onlineapps/conn-orch-orchestrator 1.0.47 → 1.0.48
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/package.json +1 -1
- package/src/WorkflowOrchestrator.js +26 -4
package/package.json
CHANGED
|
@@ -253,10 +253,6 @@ class WorkflowOrchestrator {
|
|
|
253
253
|
// Ignore - use default 0
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
// NOTE: We do NOT publish workflow_progress on every retry attempt.
|
|
257
|
-
// Instead, we publish ONE progress event at the end (either success or final failure with DLQ entry).
|
|
258
|
-
// This keeps the trace clean - one entry per step, with complete _dlq_history in context.
|
|
259
|
-
|
|
260
256
|
// Add attempt to DLQ history
|
|
261
257
|
const attemptRecord = {
|
|
262
258
|
step_id: current_step,
|
|
@@ -281,6 +277,32 @@ class WorkflowOrchestrator {
|
|
|
281
277
|
attempt: attemptNumber
|
|
282
278
|
});
|
|
283
279
|
|
|
280
|
+
// Publish progress event for EACH retry attempt (granular tracking)
|
|
281
|
+
const { publishToMonitoringWorkflow } = require('@onlineapps/mq-client-core').monitoring;
|
|
282
|
+
try {
|
|
283
|
+
await publishToMonitoringWorkflow(this.mqClient, {
|
|
284
|
+
event_type: 'progress',
|
|
285
|
+
workflow_id: workflow_id,
|
|
286
|
+
service_name: serviceName,
|
|
287
|
+
step_index: failedStepIndex,
|
|
288
|
+
step_id: current_step,
|
|
289
|
+
cookbook: cookbookDef,
|
|
290
|
+
context: updatedContext, // Context with updated _dlq_history
|
|
291
|
+
output: null,
|
|
292
|
+
error: { message: error.message },
|
|
293
|
+
status: 'retry', // Mark as retry attempt
|
|
294
|
+
attempt: attemptNumber,
|
|
295
|
+
max_attempts: this.retryConfig.maxAttempts,
|
|
296
|
+
timestamp: new Date().toISOString()
|
|
297
|
+
}, this.logger, { workflow_id, step_id: current_step });
|
|
298
|
+
} catch (monitoringError) {
|
|
299
|
+
// Don't fail if monitoring publish fails
|
|
300
|
+
this.logger.warn('Failed to publish retry progress to monitoring', {
|
|
301
|
+
workflow_id,
|
|
302
|
+
error: monitoringError.message
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
|
|
284
306
|
// Check if we should retry
|
|
285
307
|
if (attemptNumber < this.retryConfig.maxAttempts) {
|
|
286
308
|
// Calculate delay with exponential backoff
|