code: func (h *RequestDurationStatsHandler) HandleRPC(ctx context.Context, stat stats.RPCStats) {
  	lab, _ := ctx.Value(tagRPCKey).(prometheus.Labels)
  
  	switch s := stat.(type) {
  	case *stats.End:
  		switch {
  		case stat.IsClient() && h.subsystem == Client:
  			h.vec.With(lab).Observe(s.EndTime.Sub(s.BeginTime).Seconds())
  		case !stat.IsClient() && h.subsystem == Server:
  			h.vec.With(lab).Observe(s.EndTime.Sub(s.BeginTime).Seconds())
  		}
  	}
  }
docs: // HandleRPC processes the RPC stats.