diff --git a/common/metrics/metric_defs.go b/common/metrics/metric_defs.go index 5e496b380f9..8468a3ee0c5 100644 --- a/common/metrics/metric_defs.go +++ b/common/metrics/metric_defs.go @@ -651,18 +651,8 @@ const ( // OperatorDeleteNamespaceScope is the metric scope for operator.OperatorDeleteNamespace OperatorDeleteNamespaceScope = "OperatorDeleteNamespace" - // FrontendStartWorkflowExecutionScope is the metric scope for frontend.StartWorkflowExecution - FrontendStartWorkflowExecutionScope = "StartWorkflowExecution" // FrontendPollWorkflowTaskQueueScope is the metric scope for frontend.PollWorkflowTaskQueue FrontendPollWorkflowTaskQueueScope = "PollWorkflowTaskQueue" - // FrontendPollActivityTaskQueueScope is the metric scope for frontend.PollActivityTaskQueue - FrontendPollActivityTaskQueueScope = "PollActivityTaskQueue" - // FrontendRecordActivityTaskHeartbeatScope is the metric scope for frontend.RecordActivityTaskHeartbeat - FrontendRecordActivityTaskHeartbeatScope = "RecordActivityTaskHeartbeat" - // FrontendRecordActivityTaskHeartbeatByIdScope is the metric scope for frontend.RecordActivityTaskHeartbeatById - FrontendRecordActivityTaskHeartbeatByIdScope = "RecordActivityTaskHeartbeatById" - // FrontendRespondWorkflowTaskCompletedScope is the metric scope for frontend.RespondWorkflowTaskCompleted - FrontendRespondWorkflowTaskCompletedScope = "RespondWorkflowTaskCompleted" // FrontendRespondWorkflowTaskFailedScope is the metric scope for frontend.RespondWorkflowTaskFailed FrontendRespondWorkflowTaskFailedScope = "RespondWorkflowTaskFailed" // FrontendRespondQueryTaskCompletedScope is the metric scope for frontend.RespondQueryTaskCompleted @@ -689,10 +679,6 @@ const ( FrontendGetWorkflowExecutionRawHistoryScope = "GetWorkflowExecutionRawHistory" // FrontendPollForWorkflowExecutionRawHistoryScope is the metric scope for frontend.GetWorkflowExecutionRawHistory FrontendPollForWorkflowExecutionRawHistoryScope = "PollForWorkflowExecutionRawHistory" - // FrontendSignalWorkflowExecutionScope is the metric scope for frontend.SignalWorkflowExecution - FrontendSignalWorkflowExecutionScope = "SignalWorkflowExecution" - // FrontendSignalWithStartWorkflowExecutionScope is the metric scope for frontend.SignalWithStartWorkflowExecution - FrontendSignalWithStartWorkflowExecutionScope = "SignalWithStartWorkflowExecution" // FrontendTerminateWorkflowExecutionScope is the metric scope for frontend.TerminateWorkflowExecution FrontendTerminateWorkflowExecutionScope = "TerminateWorkflowExecution" // FrontendDeleteWorkflowExecutionScope is the metric scope for frontend.DeleteWorkflowExecution @@ -719,8 +705,6 @@ const ( FrontendUpdateNamespaceScope = "UpdateNamespace" // FrontendDeprecateNamespaceScope is the metric scope for frontend.DeprecateNamespace FrontendDeprecateNamespaceScope = "DeprecateNamespace" - // FrontendQueryWorkflowScope is the metric scope for frontend.QueryWorkflow - FrontendQueryWorkflowScope = "QueryWorkflow" // FrontendDescribeWorkflowExecutionScope is the metric scope for frontend.DescribeWorkflowExecution FrontendDescribeWorkflowExecutionScope = "DescribeWorkflowExecution" // FrontendDescribeTaskQueueScope is the metric scope for frontend.DescribeTaskQueue @@ -731,8 +715,6 @@ const ( FrontendResetStickyTaskQueueScope = "ResetStickyTaskQueue" // FrontendListNamespacesScope is the metric scope for frontend.ListNamespace FrontendListNamespacesScope = "ListNamespaces" - // FrontendResetWorkflowExecutionScope is the metric scope for frontend.ResetWorkflowExecution - FrontendResetWorkflowExecutionScope = "ResetWorkflowExecution" // FrontendGetSearchAttributesScope is the metric scope for frontend.GetSearchAttributes FrontendGetSearchAttributesScope = "GetSearchAttributes" // FrontendGetClusterInfoScope is the metric scope for frontend.GetClusterInfo diff --git a/common/rpc/interceptor/telemetry.go b/common/rpc/interceptor/telemetry.go index 188ad865ea5..6053fe3fecc 100644 --- a/common/rpc/interceptor/telemetry.go +++ b/common/rpc/interceptor/telemetry.go @@ -66,15 +66,20 @@ var ( pollActivityTaskQueue = "PollActivityTaskQueue" grpcActions = map[string]struct{}{ - metrics.FrontendQueryWorkflowScope: {}, - metrics.FrontendRecordActivityTaskHeartbeatScope: {}, - metrics.FrontendRecordActivityTaskHeartbeatByIdScope: {}, - metrics.FrontendResetWorkflowExecutionScope: {}, - metrics.FrontendStartWorkflowExecutionScope: {}, - metrics.FrontendSignalWorkflowExecutionScope: {}, - metrics.FrontendSignalWithStartWorkflowExecutionScope: {}, - metrics.FrontendRespondWorkflowTaskCompletedScope: {}, - metrics.FrontendPollActivityTaskQueueScope: {}, + "QueryWorkflow": {}, + "RecordActivityTaskHeartbeat": {}, + "RecordActivityTaskHeartbeatById": {}, + "ResetWorkflowExecution": {}, + "StartWorkflowExecution": {}, + "SignalWorkflowExecution": {}, + "SignalWithStartWorkflowExecution": {}, + "RespondWorkflowTaskCompleted": {}, + "PollActivityTaskQueue": {}, + "CreateSchedule": {}, + "UpdateSchedule": {}, + "DeleteSchedule": {}, + "PatchSchedule": {}, + "UpdateWorkflowExecution": {}, } commandActions = map[enums.CommandType]struct{}{ diff --git a/common/rpc/interceptor/telemetry_test.go b/common/rpc/interceptor/telemetry_test.go index e5c7435510e..bc980e675a1 100644 --- a/common/rpc/interceptor/telemetry_test.go +++ b/common/rpc/interceptor/telemetry_test.go @@ -36,6 +36,11 @@ import ( "go.temporal.io/server/common/namespace" ) +const ( + startWorkflow = "StartWorkflowExecution" + queryWorkflow = "QueryWorkflow" +) + func TestEmitActionMetric(t *testing.T) { controller := gomock.NewController(t) register := namespace.NewMockRegistry(controller) @@ -48,18 +53,18 @@ func TestEmitActionMetric(t *testing.T) { expectEmitMetrics bool }{ { - metrics.FrontendQueryWorkflowScope, - api.WorkflowServicePrefix + metrics.FrontendQueryWorkflowScope, + queryWorkflow, + api.WorkflowServicePrefix + queryWorkflow, true, }, { - metrics.FrontendQueryWorkflowScope, - metrics.FrontendQueryWorkflowScope, + queryWorkflow, + api.AdminServicePrefix + queryWorkflow, false, }, { metrics.MatchingClientAddWorkflowTaskScope, - api.WorkflowServicePrefix + metrics.FrontendQueryWorkflowScope, + api.WorkflowServicePrefix + queryWorkflow, false, }, } @@ -98,9 +103,9 @@ func TestOperationOverwrite(t *testing.T) { "OperatorDeleteNamespace", }, { - metrics.FrontendStartWorkflowExecutionScope, - api.WorkflowServicePrefix + metrics.FrontendStartWorkflowExecutionScope, - metrics.FrontendStartWorkflowExecutionScope, + startWorkflow, + api.WorkflowServicePrefix + startWorkflow, + startWorkflow, }, }