From d85cee027766442faaf16c7715c79d6c32fc789d Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 17 Sep 2015 16:33:14 +0200 Subject: [PATCH] Remove compression from web interface --- web/web.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web/web.go b/web/web.go index 0c9d6fa58..8b15087e9 100644 --- a/web/web.go +++ b/web/web.go @@ -156,12 +156,8 @@ func New(st local.Storage, qe *promql.Engine, rm *rules.Manager, status *Prometh router = router.WithPrefix(o.ExternalURL.Path) } - instrh := func(name string, h http.Handler) http.HandlerFunc { - return prometheus.InstrumentHandler(name, httputil.CompressionHandler{h}) - } - instrf := func(name string, f http.HandlerFunc) http.HandlerFunc { - return instrh(name, f) - } + instrh := prometheus.InstrumentHandler + instrf := prometheus.InstrumentHandlerFunc router.Get("/", func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/graph", http.StatusFound) @@ -174,9 +170,12 @@ func New(st local.Storage, qe *promql.Engine, rm *rules.Manager, status *Prometh router.Get("/heap", instrf("heap", dumpHeap)) - router.Get("/federate", instrf("federate", h.federation)) router.Get(o.MetricsPath, prometheus.Handler().ServeHTTP) + router.Get("/federate", instrh("federate", httputil.CompressionHandler{ + http.HandlerFunc(h.federation), + })) + h.apiLegacy.Register(router.WithPrefix("/api")) h.apiV1.Register(router.WithPrefix("/api/v1"))