Skip to content

Commit

Permalink
Add workflow type tag when emitting workflow completion metrics (#3670)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored Oct 20, 2020
1 parent 2c08e6e commit 3e32b94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/history/execution/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,9 @@ func (c *contextImpl) UpdateWorkflowExecutionWithNew(
// emit workflow completion stats if any
if currentWorkflow.ExecutionInfo.State == persistence.WorkflowStateCompleted {
if event, err := c.mutableState.GetCompletionEvent(ctx); err == nil {
workflowType := currentWorkflow.ExecutionInfo.WorkflowTypeName
taskList := currentWorkflow.ExecutionInfo.TaskList
emitWorkflowCompletionStats(c.metricsClient, domainName, taskList, event)
emitWorkflowCompletionStats(c.metricsClient, domainName, workflowType, taskList, event)
}
}

Expand Down
2 changes: 2 additions & 0 deletions service/history/execution/context_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func emitSessionUpdateStats(
func emitWorkflowCompletionStats(
metricsClient metrics.Client,
domainName string,
workflowType string,
taskList string,
event *workflow.HistoryEvent,
) {
Expand All @@ -121,6 +122,7 @@ func emitWorkflowCompletionStats(
scope := metricsClient.Scope(
metrics.WorkflowCompletionStatsScope,
metrics.DomainTag(domainName),
metrics.WorkflowTypeTag(workflowType),
metrics.TaskListTag(taskList),
)

Expand Down

0 comments on commit 3e32b94

Please sign in to comment.