From 328fd9fe1488aa43b76db4b586a70ec3511b5625 Mon Sep 17 00:00:00 2001 From: patrickhuie19 Date: Tue, 26 Nov 2024 06:25:53 -0500 Subject: [PATCH] nil guard if Vertex errs --- core/services/workflows/engine.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index fbd25bd8a15..fb99e9428cb 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -783,11 +783,14 @@ func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) { inputs, outputs, err := e.executeStep(ctx, l, msg) stepExecutionDuration := time.Since(stepExecutionStartTime).Seconds() + curStepID := "UNSET" curStep, verr := e.workflow.Vertex(msg.stepRef) - if verr != nil { + if verr == nil { + curStepID = curStep.ID + } else { l.Errorf("failed to resolve step in workflow; error %v", err) } - e.metrics.with(platform.KeyCapabilityID, curStep.ID).updateWorkflowStepDurationHistogram(ctx, int64(stepExecutionDuration)) + e.metrics.with(platform.KeyCapabilityID, curStepID).updateWorkflowStepDurationHistogram(ctx, int64(stepExecutionDuration)) var stepStatus string switch {