prometheus: enable gzip for /metrics endpoint

closes #9464
This commit is contained in:
bergquist 2017-10-23 09:35:46 +02:00
parent 1fd2270a93
commit 139f077453
2 changed files with 6 additions and 3 deletions

View File

@ -188,9 +188,8 @@ func (hs *HttpServer) metricsEndpoint(ctx *macaron.Context) {
return
}
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{
DisableCompression: true,
}).ServeHTTP(ctx.Resp, ctx.Req.Request)
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}).
ServeHTTP(ctx.Resp, ctx.Req.Request)
}
func (hs *HttpServer) healthHandler(ctx *macaron.Context) {

View File

@ -21,6 +21,10 @@ func Gziper() macaron.Handler {
return
}
if strings.HasPrefix(requestPath, "/metrics") {
return
}
ctx.Invoke(macaronGziper)
}
}