Skip to content

Commit

Permalink
CDNC-2088 (uber#5094) Add attempt-count to task processing logs
Browse files Browse the repository at this point in the history
* CDNC-2088 Add attempt-count to task processing logs in file service/history/task/task.go
Also changed AttemptCount in tags.go to be type int.

* delete comments that was used for self reminder

* add attemptCount to log in file service/history/task/cross_cluster_task.go
  • Loading branch information
bowenxia authored Feb 14, 2023
1 parent dd95446 commit fbe72b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/log/tag/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ func Attempt(attempt int32) Tag {
}

// AttemptCount returns tag for AttemptCount
func AttemptCount(attemptCount int64) Tag {
return newInt64("attempt-count", attemptCount)
func AttemptCount(attemptCount int) Tag {
return newInt("attempt-count", attemptCount)
}

// AttemptStart returns tag for AttemptStart
Expand Down
6 changes: 5 additions & 1 deletion service/history/task/cross_cluster_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ func (t *crossClusterSourceTask) HandleErr(
if attempt > t.maxRetryCount {
t.scope.RecordTimer(metrics.TaskAttemptTimerPerDomain, time.Duration(attempt))
t.logger.Error("Critical error processing task, retrying.",
tag.Error(err), tag.OperationCritical, tag.TaskType(t.GetTaskType()))
tag.Error(err),
tag.OperationCritical,
tag.TaskType(t.GetTaskType()),
tag.AttemptCount(t.GetAttempt()),
)
}
}
}()
Expand Down
1 change: 1 addition & 0 deletions service/history/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ func (t *taskImpl) HandleErr(
tag.Error(err),
tag.OperationCritical,
tag.TaskType(t.GetTaskType()),
tag.AttemptCount(t.GetAttempt()),
)
}
}
Expand Down

0 comments on commit fbe72b3

Please sign in to comment.