Skip to content

Commit

Permalink
Correct the tags on the logs (uber#1806)
Browse files Browse the repository at this point in the history
Fix workflow ID, run ID, domain and workflow type tags
  • Loading branch information
shreyassrivatsan authored and venkat1109 committed May 8, 2019
1 parent d94548a commit 0de78ac
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions common/persistence/visibilitySamplingClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ func (p *visibilitySamplingClient) RecordWorkflowExecutionStarted(request *Recor

p.logger.Info("Request for open workflow is sampled",
tag.WorkflowDomainID(domain),
tag.WorkflowType(request.Execution.GetWorkflowId()),
tag.WorkflowID(request.Execution.GetRunId()),
tag.WorkflowRunID(request.WorkflowTypeName),
tag.WorkflowType(request.WorkflowTypeName),
tag.WorkflowID(request.Execution.GetWorkflowId()),
tag.WorkflowRunID(request.Execution.GetRunId()),
)
p.metricClient.IncCounter(metrics.PersistenceRecordWorkflowExecutionStartedScope, metrics.PersistenceSampledCounter)
return nil
Expand All @@ -124,9 +124,9 @@ func (p *visibilitySamplingClient) RecordWorkflowExecutionClosed(request *Record

p.logger.Info("Request for closed workflow is sampled",
tag.WorkflowDomainID(domain),
tag.WorkflowType(request.Execution.GetWorkflowId()),
tag.WorkflowID(request.Execution.GetRunId()),
tag.WorkflowRunID(request.WorkflowTypeName),
tag.WorkflowType(request.WorkflowTypeName),
tag.WorkflowID(request.Execution.GetWorkflowId()),
tag.WorkflowRunID(request.Execution.GetRunId()),
)
p.metricClient.IncCounter(metrics.PersistenceRecordWorkflowExecutionClosedScope, metrics.PersistenceSampledCounter)
return nil
Expand Down
8 changes: 4 additions & 4 deletions service/history/queueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ func (p *queueProcessorBase) initializeLoggerForTask(task queueTaskInfo) log.Log
switch task := task.(type) {
case *persistence.TransferTaskInfo:
logger = logger.WithTags(
tag.WorkflowID(task.RunID),
tag.WorkflowRunID(task.WorkflowID),
tag.WorkflowID(task.WorkflowID),
tag.WorkflowRunID(task.RunID),
tag.WorkflowDomainID(task.DomainID))

logger.Debug("Processing transfer task")
case *persistence.ReplicationTaskInfo:
logger = logger.WithTags(
tag.WorkflowID(task.RunID),
tag.WorkflowRunID(task.WorkflowID),
tag.WorkflowID(task.WorkflowID),
tag.WorkflowRunID(task.RunID),
tag.WorkflowDomainID(task.DomainID))

logger.Debug("Processing replication task")
Expand Down
12 changes: 6 additions & 6 deletions service/history/timerQueueProcessorBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ func (t *timerQueueProcessorBase) ackTaskOnce(task *persistence.TimerTaskInfo, s

func (t *timerQueueProcessorBase) initializeLoggerForTask(task *persistence.TimerTaskInfo) log.Logger {
logger := t.logger.WithTags(
tag.WorkflowID(task.RunID),
tag.WorkflowRunID(task.WorkflowID),
tag.WorkflowID(task.WorkflowID),
tag.WorkflowRunID(task.RunID),
tag.WorkflowDomainID(task.DomainID),
tag.ShardID(t.shard.GetShardID()),
tag.TaskID(task.GetTaskID()),
Expand Down Expand Up @@ -644,8 +644,8 @@ func (t *timerQueueProcessorBase) archiveWorkflow(task *persistence.TimerTaskInf
// send signal before deleting mutable state to make sure archival is idempotent
if err := t.historyService.archivalClient.Archive(req); err != nil {
t.logger.Error("failed to initiate archival", tag.Error(err),
tag.WorkflowID(task.RunID),
tag.WorkflowRunID(task.WorkflowID),
tag.WorkflowID(task.WorkflowID),
tag.WorkflowRunID(task.RunID),
tag.WorkflowDomainID(task.DomainID),
tag.ShardID(t.shard.GetShardID()),
tag.TaskID(task.GetTaskID()),
Expand Down Expand Up @@ -682,8 +682,8 @@ func (t *timerQueueProcessorBase) deleteWorkflowHistory(task *persistence.TimerT
domainID, workflowExecution := t.getDomainIDAndWorkflowExecution(task)
op := func() error {
if msBuilder.GetEventStoreVersion() == persistence.EventStoreVersionV2 {
logger := t.logger.WithTags(tag.WorkflowID(task.RunID),
tag.WorkflowRunID(task.WorkflowID),
logger := t.logger.WithTags(tag.WorkflowID(task.WorkflowID),
tag.WorkflowRunID(task.RunID),
tag.WorkflowDomainID(task.DomainID),
tag.ShardID(t.shard.GetShardID()),
tag.TaskID(task.GetTaskID()),
Expand Down
4 changes: 2 additions & 2 deletions service/history/timerQueueStandbyProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ func (t *timerQueueStandbyProcessorImpl) fetchHistoryFromRemote(timerTask *persi
)
if err != nil {
t.logger.Error("Error re-replicating history from remote.",
tag.WorkflowID(timerTask.RunID),
tag.WorkflowRunID(timerTask.WorkflowID),
tag.WorkflowID(timerTask.WorkflowID),
tag.WorkflowRunID(timerTask.RunID),
tag.WorkflowDomainID(timerTask.DomainID),
tag.ShardID(t.shard.GetShardID()),
tag.WorkflowNextEventID(nextEventID),
Expand Down
6 changes: 3 additions & 3 deletions service/history/workflowExecutionContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ func newWorkflowExecutionContext(
logger log.Logger,
) *workflowExecutionContextImpl {
lg := logger.WithTags(
tag.WorkflowID(domainID),
tag.WorkflowRunID(execution.GetWorkflowId()),
tag.WorkflowDomainID(execution.GetRunId()))
tag.WorkflowID(execution.GetWorkflowId()),
tag.WorkflowRunID(execution.GetRunId()),
tag.WorkflowDomainID(domainID))

return &workflowExecutionContextImpl{
domainID: domainID,
Expand Down

0 comments on commit 0de78ac

Please sign in to comment.