(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption)
| 83 | } |
| 84 | |
| 85 | func (h *clientMetricsHandler) unaryInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { |
| 86 | ctx, ci := getOrCreateCallInfo(ctx, cc, method, opts...) |
| 87 | |
| 88 | if h.options.MetricsOptions.pluginOption != nil { |
| 89 | md := h.options.MetricsOptions.pluginOption.GetMetadata() |
| 90 | for k, vs := range md { |
| 91 | for _, v := range vs { |
| 92 | ctx = metadata.AppendToOutgoingContext(ctx, k, v) |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | startTime := time.Now() |
| 98 | err := invoker(ctx, method, req, reply, cc, opts...) |
| 99 | h.perCallMetrics(ctx, err, startTime, ci) |
| 100 | return err |
| 101 | } |
| 102 | |
| 103 | // determineMethod determines the method to record attributes with. This will be |
| 104 | // "other" if StaticMethod isn't specified or if method filter is set and |
nothing calls this directly
no test coverage detected