Skip to content

Commit

Permalink
Fix action metrics (#3434)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc authored and dnr committed Sep 29, 2022
1 parent 3c0105b commit adc4cc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/rpc/interceptor/telemetry.go
Expand Up @@ -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
Expand Down

0 comments on commit adc4cc8

Please sign in to comment.