diff --git a/middleware.go b/middleware.go index 9a3adb4..8d99043 100644 --- a/middleware.go +++ b/middleware.go @@ -91,6 +91,9 @@ func monitoringMiddleware(h http.Handler) http.Handler { "request.path": r.URL.Path, "response.size": m.Written, }) + if r.RemoteAddr != "" { + event.addField("request.ip", r.RemoteAddr) + } promHTTPRequestCounter.With(prometheus.Labels{ "code": fmt.Sprintf("%dXX", m.Code/100),