From 0fc50f827fd34e935296ceffa6c96f74800a215a Mon Sep 17 00:00:00 2001 From: Yimin Chen Date: Thu, 26 Oct 2023 23:33:27 -0700 Subject: [PATCH] Adjust action metrics (#5043) **What changed?** Adjust action metrics **Why?** To reflect pricing change. **How did you test it?** Run locally and verify metrics. **Potential risks** No **Is hotfix candidate?** --- common/rpc/interceptor/telemetry.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/rpc/interceptor/telemetry.go b/common/rpc/interceptor/telemetry.go index 8d285087ec8..188ad865ea5 100644 --- a/common/rpc/interceptor/telemetry.go +++ b/common/rpc/interceptor/telemetry.go @@ -221,8 +221,10 @@ func (ti *TelemetryInterceptor) emitActionMetric( case enums.COMMAND_TYPE_RECORD_MARKER: // handle RecordMarker command, they are used for localActivity, sideEffect, versioning etc. hasMarker = true - markerName := command.GetRecordMarkerCommandAttributes().GetMarkerName() - metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_RecordMarker_"+markerName)) + case enums.COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION: + // Each child workflow counts as 2 actions. We use separate tags to track them separately. + metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String())) + metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String()+"_Extra")) default: // handle all other command action metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String()))