Skip to content

Commit 3e32b94

Browse files
authored
Add workflow type tag when emitting workflow completion metrics (cadence-workflow#3670)
1 parent 2c08e6e commit 3e32b94

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

service/history/execution/context.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,9 @@ func (c *contextImpl) UpdateWorkflowExecutionWithNew(
799799
// emit workflow completion stats if any
800800
if currentWorkflow.ExecutionInfo.State == persistence.WorkflowStateCompleted {
801801
if event, err := c.mutableState.GetCompletionEvent(ctx); err == nil {
802+
workflowType := currentWorkflow.ExecutionInfo.WorkflowTypeName
802803
taskList := currentWorkflow.ExecutionInfo.TaskList
803-
emitWorkflowCompletionStats(c.metricsClient, domainName, taskList, event)
804+
emitWorkflowCompletionStats(c.metricsClient, domainName, workflowType, taskList, event)
804805
}
805806
}
806807

service/history/execution/context_util.go

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func emitSessionUpdateStats(
110110
func emitWorkflowCompletionStats(
111111
metricsClient metrics.Client,
112112
domainName string,
113+
workflowType string,
113114
taskList string,
114115
event *workflow.HistoryEvent,
115116
) {
@@ -121,6 +122,7 @@ func emitWorkflowCompletionStats(
121122
scope := metricsClient.Scope(
122123
metrics.WorkflowCompletionStatsScope,
123124
metrics.DomainTag(domainName),
125+
metrics.WorkflowTypeTag(workflowType),
124126
metrics.TaskListTag(taskList),
125127
)
126128

0 commit comments

Comments
 (0)