From adc4cc82ca4e8067c5f78a50e871713b3ca6a62f Mon Sep 17 00:00:00 2001 From: Yimin Chen Date: Tue, 27 Sep 2022 18:00:49 -0700 Subject: [PATCH] Fix action metrics (#3434) --- common/rpc/interceptor/telemetry.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/rpc/interceptor/telemetry.go b/common/rpc/interceptor/telemetry.go index 6d9259a713a..d411cba8d87 100644 --- a/common/rpc/interceptor/telemetry.go +++ b/common/rpc/interceptor/telemetry.go @@ -147,18 +147,19 @@ func (ti *TelemetryInterceptor) Intercept( } // emit action metrics only after successful calls - ti.emitActionMetric(methodName, req, metricsScope, resp) + ti.emitActionMetric(methodName, info.FullMethod, req, metricsScope, resp) return resp, nil } func (ti *TelemetryInterceptor) emitActionMetric( methodName string, + fullName string, req interface{}, scope metrics.Scope, result interface{}, ) { - if actionScope, ok := grpcActions[methodName]; !ok || actionScope != ti.scopes[methodName] { + if actionScope, ok := grpcActions[methodName]; !ok || actionScope != ti.scopes[fullName] { // grpcActions checks that methodName is the one that we care about. // ti.scopes verifies that the scope is the one we intended to emit action metrics. // This is necessary because TelemetryInterceptor is used for all services. Different service could have same