File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
temporal-sdk/src/main/java/io/temporal/internal Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,5 @@ private LoggerTag() {}
37
37
public static final String WORKER_TYPE = "WorkerType" ;
38
38
public static final String SIDE_EFFECT_ID = "SideEffectId" ;
39
39
public static final String CHILD_WORKFLOW_ID = "ChildWorkflowId" ;
40
+ public static final String ATTEMPT = "Attempt" ;
40
41
}
Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ public void handle(ActivityTask task) throws Exception {
247
247
MDC .put (LoggerTag .WORKFLOW_ID , pollResponse .getWorkflowExecution ().getWorkflowId ());
248
248
MDC .put (LoggerTag .WORKFLOW_TYPE , pollResponse .getWorkflowType ().getName ());
249
249
MDC .put (LoggerTag .RUN_ID , pollResponse .getWorkflowExecution ().getRunId ());
250
+ MDC .put (LoggerTag .ATTEMPT , Integer .toString (pollResponse .getAttempt ()));
250
251
251
252
ActivityTaskHandler .Result result = null ;
252
253
try {
@@ -257,6 +258,7 @@ public void handle(ActivityTask task) throws Exception {
257
258
MDC .remove (LoggerTag .WORKFLOW_ID );
258
259
MDC .remove (LoggerTag .WORKFLOW_TYPE );
259
260
MDC .remove (LoggerTag .RUN_ID );
261
+ MDC .remove (LoggerTag .ATTEMPT );
260
262
if (
261
263
// handleActivity throw an exception (not a normal scenario)
262
264
result == null
Original file line number Diff line number Diff line change @@ -441,6 +441,7 @@ public void handle(LocalActivityAttemptTask attemptTask) throws Exception {
441
441
MDC .put (LoggerTag .WORKFLOW_ID , activityTask .getWorkflowExecution ().getWorkflowId ());
442
442
MDC .put (LoggerTag .WORKFLOW_TYPE , activityTask .getWorkflowType ().getName ());
443
443
MDC .put (LoggerTag .RUN_ID , activityTask .getWorkflowExecution ().getRunId ());
444
+ MDC .put (LoggerTag .ATTEMPT , Integer .toString (activityTask .getAttempt ()));
444
445
445
446
slotSupplier .markSlotUsed (
446
447
new LocalActivitySlotInfo (
@@ -506,6 +507,7 @@ public void handle(LocalActivityAttemptTask attemptTask) throws Exception {
506
507
MDC .remove (LoggerTag .WORKFLOW_ID );
507
508
MDC .remove (LoggerTag .WORKFLOW_TYPE );
508
509
MDC .remove (LoggerTag .RUN_ID );
510
+ MDC .remove (LoggerTag .ATTEMPT );
509
511
}
510
512
}
511
513
You can’t perform that action at this time.
0 commit comments