Commit 139f0774 by bergquist

prometheus: enable gzip for /metrics endpoint

closes #9464
parent 1fd2270a
...@@ -188,9 +188,8 @@ func (hs *HttpServer) metricsEndpoint(ctx *macaron.Context) { ...@@ -188,9 +188,8 @@ func (hs *HttpServer) metricsEndpoint(ctx *macaron.Context) {
return return
} }
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{ promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}).
DisableCompression: true, ServeHTTP(ctx.Resp, ctx.Req.Request)
}).ServeHTTP(ctx.Resp, ctx.Req.Request)
} }
func (hs *HttpServer) healthHandler(ctx *macaron.Context) { func (hs *HttpServer) healthHandler(ctx *macaron.Context) {
......
...@@ -21,6 +21,10 @@ func Gziper() macaron.Handler { ...@@ -21,6 +21,10 @@ func Gziper() macaron.Handler {
return return
} }
if strings.HasPrefix(requestPath, "/metrics") {
return
}
ctx.Invoke(macaronGziper) ctx.Invoke(macaronGziper)
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment