From 363a19b3218bf23d446b25c451f12ba343eec6f2 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Fri, 7 Jun 2019 09:20:40 -0500 Subject: [PATCH] Add request method to stats --- http/handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/handler.go b/http/handler.go index f2fe355e4..468a43da2 100644 --- a/http/handler.go +++ b/http/handler.go @@ -241,7 +241,7 @@ func (h *Handler) collectStats(next http.Handler) http.Handler { next.ServeHTTP(w, r) dur := time.Since(t) - statsTags := make([]string, 0, 4) + statsTags := make([]string, 0, 5) longQueryTime := h.api.LongQueryTime() if longQueryTime > 0 && dur > longQueryTime { @@ -261,6 +261,8 @@ func (h *Handler) collectStats(next http.Handler) http.Handler { statsTags = append(statsTags, "path:"+path) } + statsTags = append(statsTags, "method:"+r.Method) + stats := h.api.StatsWithTags(statsTags) if stats != nil { stats.Timing("http.request", dur, 0.1)