diff --git a/einterfaces/metrics.go b/einterfaces/metrics.go index c5d74fe903..a56a9246f7 100644 --- a/einterfaces/metrics.go +++ b/einterfaces/metrics.go @@ -43,8 +43,8 @@ type MetricsInterface interface { IncrementPostsSearchCounter() ObservePostsSearchDuration(elapsed float64) - ObserveStoreMethodDuration(method string, success string, elapsed float64) - ObserveApiEndpointDuration(endpoint string, elapsed float64) + ObserveStoreMethodDuration(method, success string, elapsed float64) + ObserveApiEndpointDuration(endpoint, method string, elapsed float64) IncrementPostIndexCounter() IncrementUserIndexCounter() IncrementChannelIndexCounter() diff --git a/web/handlers.go b/web/handlers.go index 041349a9b5..ac650836fc 100644 --- a/web/handlers.go +++ b/web/handlers.go @@ -214,7 +214,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if r.URL.Path != model.API_URL_SUFFIX+"/websocket" { elapsed := float64(time.Since(now)) / float64(time.Second) c.App.Metrics.ObserveHttpRequestDuration(elapsed) - c.App.Metrics.ObserveApiEndpointDuration(h.HandlerName, elapsed) + c.App.Metrics.ObserveApiEndpointDuration(h.HandlerName, r.Method, elapsed) } } }