Skip to content

Commit 8757db2

Browse files
authored
Merge pull request #306 from cschleiden/always-log-instance-execution-ids
Always log workflow instance and execution id from executor
2 parents f2e35fe + abff4b0 commit 8757db2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/workflow/executor.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ func NewExecutor(
9393
}
9494
}
9595

96+
logger = logger.With(
97+
slog.String(log.InstanceIDKey, instance.InstanceID),
98+
slog.String(log.ExecutionIDKey, instance.ExecutionID),
99+
)
100+
96101
// Get span from the workflow context, set by the default context propagator
97102
parentSpan := workflowtracer.SpanFromContext(wfCtx)
98103

@@ -114,8 +119,6 @@ func NewExecutor(
114119
func (e *executor) ExecuteTask(ctx context.Context, t *backend.WorkflowTask) (*ExecutionResult, error) {
115120
logger := e.logger.With(
116121
log.TaskIDKey, t.ID,
117-
log.InstanceIDKey, t.WorkflowInstance.InstanceID,
118-
log.ExecutionIDKey, t.WorkflowInstance.ExecutionID,
119122
)
120123

121124
logger.Debug("Executing workflow task", log.TaskLastSequenceIDKey, t.LastSequenceID)

0 commit comments

Comments
 (0)