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() {}
3737 public static final String WORKER_TYPE = "WorkerType" ;
3838 public static final String SIDE_EFFECT_ID = "SideEffectId" ;
3939 public static final String CHILD_WORKFLOW_ID = "ChildWorkflowId" ;
40+ public static final String ATTEMPT = "Attempt" ;
4041}
Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ public void handle(ActivityTask task) throws Exception {
247247 MDC .put (LoggerTag .WORKFLOW_ID , pollResponse .getWorkflowExecution ().getWorkflowId ());
248248 MDC .put (LoggerTag .WORKFLOW_TYPE , pollResponse .getWorkflowType ().getName ());
249249 MDC .put (LoggerTag .RUN_ID , pollResponse .getWorkflowExecution ().getRunId ());
250+ MDC .put (LoggerTag .ATTEMPT , Integer .toString (pollResponse .getAttempt ()));
250251
251252 ActivityTaskHandler .Result result = null ;
252253 try {
@@ -257,6 +258,7 @@ public void handle(ActivityTask task) throws Exception {
257258 MDC .remove (LoggerTag .WORKFLOW_ID );
258259 MDC .remove (LoggerTag .WORKFLOW_TYPE );
259260 MDC .remove (LoggerTag .RUN_ID );
261+ MDC .remove (LoggerTag .ATTEMPT );
260262 if (
261263 // handleActivity throw an exception (not a normal scenario)
262264 result == null
Original file line number Diff line number Diff line change @@ -441,6 +441,7 @@ public void handle(LocalActivityAttemptTask attemptTask) throws Exception {
441441 MDC .put (LoggerTag .WORKFLOW_ID , activityTask .getWorkflowExecution ().getWorkflowId ());
442442 MDC .put (LoggerTag .WORKFLOW_TYPE , activityTask .getWorkflowType ().getName ());
443443 MDC .put (LoggerTag .RUN_ID , activityTask .getWorkflowExecution ().getRunId ());
444+ MDC .put (LoggerTag .ATTEMPT , Integer .toString (activityTask .getAttempt ()));
444445
445446 slotSupplier .markSlotUsed (
446447 new LocalActivitySlotInfo (
@@ -506,6 +507,7 @@ public void handle(LocalActivityAttemptTask attemptTask) throws Exception {
506507 MDC .remove (LoggerTag .WORKFLOW_ID );
507508 MDC .remove (LoggerTag .WORKFLOW_TYPE );
508509 MDC .remove (LoggerTag .RUN_ID );
510+ MDC .remove (LoggerTag .ATTEMPT );
509511 }
510512 }
511513
You can’t perform that action at this time.
0 commit comments