mirror of https://github.com/k3s-io/k3s
commit
a4bc22e263
|
@ -87,7 +87,7 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||
var apiResource string
|
||||
var httpCode int
|
||||
reqStart := time.Now()
|
||||
defer func() { monitor("proxy", verb, apiResource, httpCode, reqStart) }()
|
||||
defer monitor("proxy", verb, apiResource, httpCode, reqStart)
|
||||
|
||||
requestInfo, err := r.apiRequestInfoResolver.GetAPIRequestInfo(req)
|
||||
if err != nil {
|
||||
|
|
|
@ -38,7 +38,7 @@ func (r *RedirectHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||
var apiResource string
|
||||
var httpCode int
|
||||
reqStart := time.Now()
|
||||
defer func() { monitor("redirect", verb, apiResource, httpCode, reqStart) }()
|
||||
defer monitor("redirect", verb, apiResource, httpCode, reqStart)
|
||||
|
||||
requestInfo, err := r.apiRequestInfoResolver.GetAPIRequestInfo(req)
|
||||
if err != nil {
|
||||
|
|
|
@ -75,7 +75,7 @@ type ServerStatus struct {
|
|||
func (v *validator) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
var httpCode int
|
||||
reqStart := time.Now()
|
||||
defer func() { monitor("validate", "get", "", httpCode, reqStart) }()
|
||||
defer monitor("validate", "get", "", httpCode, reqStart)
|
||||
|
||||
reply := []ServerStatus{}
|
||||
for name, server := range v.servers() {
|
||||
|
|
|
@ -88,7 +88,7 @@ func (h *WatchHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||
var apiResource string
|
||||
var httpCode int
|
||||
reqStart := time.Now()
|
||||
defer func() { monitor("watch", verb, apiResource, httpCode, reqStart) }()
|
||||
defer monitor("watch", verb, apiResource, httpCode, reqStart)
|
||||
|
||||
if req.Method != "GET" {
|
||||
notFound(w, req)
|
||||
|
|
Loading…
Reference in New Issue