Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func WithActivityTask(
zapcore.Field{Key: tagWorkflowType, Type: zapcore.StringType, String: *task.WorkflowType.Name},
zapcore.Field{Key: tagWorkflowID, Type: zapcore.StringType, String: *task.WorkflowExecution.WorkflowId},
zapcore.Field{Key: tagRunID, Type: zapcore.StringType, String: *task.WorkflowExecution.RunId},
zapcore.Field{Key: tagAttempt, Type: zapcore.Int64Type, Integer: int64(*task.Attempt)},
)

return context.WithValue(ctx, activityEnvContextKey, &activityEnvironment{
Expand Down
5 changes: 5 additions & 0 deletions internal/activity_task_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestActivityTaskHandler_Execute_deadline(t *testing.T) {
ScheduleToCloseTimeoutSeconds: common.Int32Ptr(d.ScheduleDuration),
StartedTimestamp: common.Int64Ptr(d.StartTS.UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(d.StartDuration),
Attempt: common.Int32Ptr(0),
WorkflowType: &s.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down Expand Up @@ -139,6 +140,7 @@ func TestActivityTaskHandler_Execute_worker_stop(t *testing.T) {
ScheduleToCloseTimeoutSeconds: common.Int32Ptr(1),
StartedTimestamp: common.Int64Ptr(now.UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(1),
Attempt: common.Int32Ptr(0),
WorkflowType: &s.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down Expand Up @@ -193,6 +195,7 @@ func TestActivityTaskHandler_Execute_with_propagators(t *testing.T) {
ScheduleToCloseTimeoutSeconds: common.Int32Ptr(1),
StartedTimestamp: common.Int64Ptr(now.UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(1),
Attempt: common.Int32Ptr(0),
WorkflowType: &s.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down Expand Up @@ -245,6 +248,7 @@ func TestActivityTaskHandler_Execute_with_propagator_failure(t *testing.T) {
ScheduleToCloseTimeoutSeconds: common.Int32Ptr(1),
StartedTimestamp: common.Int64Ptr(now.UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(1),
Attempt: common.Int32Ptr(0),
WorkflowType: &s.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down Expand Up @@ -301,6 +305,7 @@ func TestActivityTaskHandler_Execute_with_auto_heartbeat(t *testing.T) {
StartedTimestamp: common.Int64Ptr(now.UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(1),
HeartbeatTimeoutSeconds: common.Int32Ptr(1),
Attempt: common.Int32Ptr(0),
WorkflowType: &s.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down
1 change: 1 addition & 0 deletions internal/internal_logging_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
tagDomain = "Domain"
tagEventID = "EventID"
tagEventType = "EventType"
tagAttempt = "Attempt"
tagRunID = "RunID"
tagTaskList = "TaskList"
tagTimerID = "TimerID"
Expand Down
4 changes: 3 additions & 1 deletion internal/internal_task_pollers.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ func (lath *localActivityTaskHandler) executeLocalActivityTask(task *localActivi
zap.String(tagLocalActivityType, activityType),
zap.String(tagWorkflowType, workflowType),
zap.String(tagWorkflowID, task.params.WorkflowInfo.WorkflowExecution.ID),
zap.String(tagRunID, task.params.WorkflowInfo.WorkflowExecution.RunID))
zap.String(tagRunID, task.params.WorkflowInfo.WorkflowExecution.RunID),
zap.Int64(tagAttempt, int64(task.attempt)),
)

metricsScope.Counter(metrics.LocalActivityTotalCounter).Inc(1)

Expand Down
1 change: 1 addition & 0 deletions internal/internal_workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (s *WorkersTestSuite) TestActivityWorkerStop() {
ScheduleToCloseTimeoutSeconds: common.Int32Ptr(1),
StartedTimestamp: common.Int64Ptr(time.Now().UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(1),
Attempt: common.Int32Ptr(0),
WorkflowType: &m.WorkflowType{
Name: common.StringPtr("wType"),
},
Expand Down
1 change: 1 addition & 0 deletions internal/internal_workflow_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,7 @@ func newTestActivityTask(workflowID, runID, activityID, workflowTypeName, domain
StartedTimestamp: common.Int64Ptr(time.Now().UnixNano()),
StartToCloseTimeoutSeconds: common.Int32Ptr(params.StartToCloseTimeoutSeconds),
HeartbeatTimeoutSeconds: common.Int32Ptr(params.HeartbeatTimeoutSeconds),
Attempt: common.Int32Ptr(0),
WorkflowType: &shared.WorkflowType{
Name: common.StringPtr(workflowTypeName),
},
Expand Down
Loading