@onlineapps/conn-orch-orchestrator 1.0.46 → 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 -28
package/package.json
CHANGED
|
@@ -253,34 +253,6 @@ class WorkflowOrchestrator {
|
|
|
253
253
|
// Ignore - use default 0
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
// IMPORTANT: Publish progress event for FAILED step (so it appears in trace)
|
|
257
|
-
// This ensures every cookbook step is visible in monitoring, even failed ones
|
|
258
|
-
const { publishToMonitoringWorkflow } = require('@onlineapps/mq-client-core').monitoring;
|
|
259
|
-
try {
|
|
260
|
-
await publishToMonitoringWorkflow(this.mqClient, {
|
|
261
|
-
event_type: 'progress',
|
|
262
|
-
workflow_id: workflow_id,
|
|
263
|
-
service_name: serviceName,
|
|
264
|
-
step_index: failedStepIndex,
|
|
265
|
-
step_id: current_step,
|
|
266
|
-
cookbook: cookbookDef,
|
|
267
|
-
context: context,
|
|
268
|
-
output: null,
|
|
269
|
-
error: {
|
|
270
|
-
message: error.message,
|
|
271
|
-
attempt: attemptNumber
|
|
272
|
-
},
|
|
273
|
-
status: 'failed',
|
|
274
|
-
timestamp: new Date().toISOString()
|
|
275
|
-
}, this.logger, { workflow_id, step_id: current_step });
|
|
276
|
-
} catch (monitoringError) {
|
|
277
|
-
// Don't fail workflow if monitoring publish fails
|
|
278
|
-
this.logger.warn('Failed to publish failed step progress to monitoring', {
|
|
279
|
-
workflow_id,
|
|
280
|
-
error: monitoringError.message
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
|
|
284
256
|
// Add attempt to DLQ history
|
|
285
257
|
const attemptRecord = {
|
|
286
258
|
step_id: current_step,
|
|
@@ -305,6 +277,32 @@ class WorkflowOrchestrator {
|
|
|
305
277
|
attempt: attemptNumber
|
|
306
278
|
});
|
|
307
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
|
+
|
|
308
306
|
// Check if we should retry
|
|
309
307
|
if (attemptNumber < this.retryConfig.maxAttempts) {
|
|
310
308
|
// Calculate delay with exponential backoff
|