From 3e32b943aa0fac4606751f4eca6ac95da5dd9ddf Mon Sep 17 00:00:00 2001 From: Yichao Yang Date: Tue, 20 Oct 2020 12:48:15 -0700 Subject: [PATCH] Add workflow type tag when emitting workflow completion metrics (#3670) --- service/history/execution/context.go | 3 ++- service/history/execution/context_util.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/service/history/execution/context.go b/service/history/execution/context.go index e15e585499d..1ca54231927 100644 --- a/service/history/execution/context.go +++ b/service/history/execution/context.go @@ -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) } } diff --git a/service/history/execution/context_util.go b/service/history/execution/context_util.go index 0591f7ef30f..596c86517e8 100644 --- a/service/history/execution/context_util.go +++ b/service/history/execution/context_util.go @@ -110,6 +110,7 @@ func emitSessionUpdateStats( func emitWorkflowCompletionStats( metricsClient metrics.Client, domainName string, + workflowType string, taskList string, event *workflow.HistoryEvent, ) { @@ -121,6 +122,7 @@ func emitWorkflowCompletionStats( scope := metricsClient.Scope( metrics.WorkflowCompletionStatsScope, metrics.DomainTag(domainName), + metrics.WorkflowTypeTag(workflowType), metrics.TaskListTag(taskList), )