code: func InstrumentRouteFunc(verb, group, version, resource, subresource, scope, component string, routeFunc restful.RouteFunction) restful.RouteFunction {
  	return restful.RouteFunction(func(request *restful.Request, response *restful.Response) {
  		now := time.Now()
  
  		delegate := &ResponseWriterDelegator{ResponseWriter: response.ResponseWriter}
  
  		_, cn := response.ResponseWriter.(http.CloseNotifier)
  		_, fl := response.ResponseWriter.(http.Flusher)
  		_, hj := response.ResponseWriter.(http.Hijacker)
  		var rw http.ResponseWriter
  		if cn && fl && hj {
  			rw = &fancyResponseWriterDelegator{delegate}
  		} else {
  			rw = delegate
  		}
  		response.ResponseWriter = rw
  
  		routeFunc(request, response)
  
  		MonitorRequest(request.Request, verb, group, version, resource, subresource, scope, component, delegate.Header().Get("Content-Type"), delegate.Status(), delegate.ContentLength(), time.Since(now))
  	})
  }
docs: // InstrumentRouteFunc works like Prometheus' InstrumentHandlerFunc but wraps
  // the go-restful RouteFunction instead of a HandlerFunc plus some Kubernetes endpoint specific information.