Skip to content

Commit f770139

Browse files
authored
Reverts Start Workflow Action metering change (temporalio#7554)
1 parent 5b011dd commit f770139

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

common/rpc/interceptor/telemetry.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ func (ti *TelemetryInterceptor) emitActionMetric(
257257
}
258258

259259
switch methodName {
260+
case startWorkflowExecution:
261+
resp, ok := result.(*workflowservice.StartWorkflowExecutionResponse)
262+
if !ok {
263+
return
264+
}
265+
if resp.Started {
266+
metrics.ActionCounter.With(metricsHandler).Record(1, metrics.ActionType("grpc_"+methodName))
267+
}
260268
case executeMultiOperation:
261269
resp, ok := result.(*workflowservice.ExecuteMultiOperationResponse)
262270
if !ok {

common/rpc/interceptor/telemetry_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,15 @@ func TestEmitActionMetric(t *testing.T) {
7171
req any
7272
resp any
7373
}{
74+
{
75+
methodName: startWorkflow,
76+
fullName: api.WorkflowServicePrefix + startWorkflow,
77+
resp: &workflowservice.StartWorkflowExecutionResponse{Started: false},
78+
},
7479
{
7580
methodName: startWorkflow,
7681
fullName: api.WorkflowServicePrefix + startWorkflow,
77-
resp: &workflowservice.StartWorkflowExecutionResponse{},
82+
resp: &workflowservice.StartWorkflowExecutionResponse{Started: true},
7883
expectEmitMetrics: true,
7984
},
8085
{

0 commit comments

Comments
 (0)