mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 23:19:41 -08:00
Merge pull request #1091 from prometheus/compress
Remove compression from web interface
This commit is contained in:
commit
aef3bb8651
13
web/web.go
13
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)
|
router = router.WithPrefix(o.ExternalURL.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
instrh := func(name string, h http.Handler) http.HandlerFunc {
|
instrh := prometheus.InstrumentHandler
|
||||||
return prometheus.InstrumentHandler(name, httputil.CompressionHandler{h})
|
instrf := prometheus.InstrumentHandlerFunc
|
||||||
}
|
|
||||||
instrf := func(name string, f http.HandlerFunc) http.HandlerFunc {
|
|
||||||
return instrh(name, f)
|
|
||||||
}
|
|
||||||
|
|
||||||
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
|
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Redirect(w, r, "/graph", http.StatusFound)
|
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("/heap", instrf("heap", dumpHeap))
|
||||||
|
|
||||||
router.Get("/federate", instrf("federate", h.federation))
|
|
||||||
router.Get(o.MetricsPath, prometheus.Handler().ServeHTTP)
|
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.apiLegacy.Register(router.WithPrefix("/api"))
|
||||||
h.apiV1.Register(router.WithPrefix("/api/v1"))
|
h.apiV1.Register(router.WithPrefix("/api/v1"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue