more specific logging

This commit is contained in:
Shawn Smith
2019-08-08 18:34:09 +09:00
parent e0bb7b2ace
commit 9f711d57eb

View File

@@ -108,7 +108,7 @@ func (m metrics) recordDuration(start time.Time, name string) {
// instrument adds metric instrumentation to the handler passed in as argument
func (m metrics) instrument(path string, h http.HandlerFunc) (string, http.HandlerFunc) {
return path, func(w http.ResponseWriter, r *http.Request) {
defer m.recordDuration(time.Now(), path)
defer m.recordDuration(time.Now(), r.URL.Path)
h.ServeHTTP(w, r)
}
}