88
func (p ReplicationLifecyclePayload) EventName() string { return ReplicationLifecycleEventName }
89
91
>
attrs := []log.KeyValue{
92
>
log.String("phase", string(p.Phase)),
93
>
log.String("task_type", p.TaskType),
94
>
log.Int64("shard", int64(p.Shard)),
95
>
log.String("namespace", p.Namespace),
96
>
log.String("namespace_id", p.NamespaceID),
97
>
log.String("workflow_id", p.WorkflowID),
98
>
log.String("run_id", p.RunID),
99
>
}
100
>
if p.FailoverVersion != 0 || p.TransitionCount != 0 {
102
>
log.Int64("failover_version", p.FailoverVersion),
103
>
log.Int64("transition_count", p.TransitionCount),
104
>
)
105
>
}
106
// parent fields are phase-independent: emitted on any phase that populated them (sent +
107
// applied). Guards keep them absent when not applicable (e.g. executing, or a workflow that is
108
// not a child).
111
>
log.String("parent_workflow_id", p.ParentWorkflowID),
112
>
log.String("parent_run_id", p.ParentRunID),
113
>
)
114
>
if p.ParentInitiatedID != 0 {
115
>
attrs = append(attrs, log.Int64("parent_initiated_id", p.ParentInitiatedID))
116
>
}
117
}
120
>
}
122
>
attrs = append(attrs, jsonAttr("event_version_history", p.EventVersionHistory))
replication_events.go
123
>
}
126
>
attrs = p.appendSent(attrs)
128
>
attrs = append(attrs, log.Int64("attempt", int64(p.Attempt)))
130
>
attrs = p.appendApplied(attrs)
131
default:
132
}
134
}
135
136
>
func (p ReplicationLifecyclePayload) appendSent(attrs []log.KeyValue) []log.KeyValue {
replication_events.go
137
>
if p.NewRunID != "" {
139
>
}
142
>
}
144
>
if p.FirstEventID != 0 {
145
>
attrs = append(attrs, log.Int64("first_event_id", p.FirstEventID))
146
>
}
147
>
if p.NextEventID != 0 {
148
>
attrs = append(attrs, log.Int64("next_event_id", p.NextEventID))
149
>
}
150
>
return attrs
151
}
152
153
>
func (p ReplicationLifecyclePayload) appendApplied(attrs []log.KeyValue) []log.KeyValue {
replication_events.go
154
>
attrs = append(attrs, log.String("outcome", p.Outcome))
155
>
if p.Error != "" {
157
>
}
159
return attrs
160
}
162
>
log.String("state", p.State),
163
>
log.String("status", p.Status),
164
>
log.Int64("applied_next_event_id", p.AppliedNextEventID),
165
>
)
166
>
if len(p.TransitionHistory) > 0 {
167
>
attrs = append(attrs, jsonAttr("transition_history", p.TransitionHistory))
168
>
}
169
>
attrs = append(attrs, log.Int64("last_event_id", p.LastEventID))
170
>
if p.LastEventVersion != 0 {
171
>
attrs = append(attrs, log.Int64("last_event_version", p.LastEventVersion))
172
>
}
173
>
if p.NewExecutionRunID != "" {
174
>
attrs = append(attrs, log.String("new_execution_run_id", p.NewExecutionRunID))
175
>
}
176
>
if p.ResetRunID != "" {
178
>
}
180
>
attrs = append(attrs, log.Int64("signal_count", p.SignalCount))
181
>
}
182
>
if p.ActivityCount != 0 {
184
>
}
187
>
}
189
>
attrs = append(attrs, log.Int64("child_execution_count", p.ChildExecutionCount))
replication_events.go
190
>
}
192
>
attrs = append(attrs, log.Int64("update_count", p.UpdateCount))
193
>
}
194
>
return attrs
195
}
196