Move metrics.StartRequest to middleware && Fix Datadog

This commit is contained in:
DarthSim
2022-01-14 00:40:14 +06:00
parent e43c24c544
commit b5863c808b
7 changed files with 39 additions and 3 deletions

View File

@@ -137,8 +137,7 @@ func respondWithNotModified(reqID string, r *http.Request, rw http.ResponseWrite
}
func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
ctx, metricsCancel, rw := metrics.StartRequest(r.Context(), rw, r)
defer metricsCancel()
ctx := r.Context()
path := r.RequestURI
if queryStart := strings.IndexByte(path, '?'); queryStart >= 0 {