Fix /debug/pprof endpoint with new web router.

This got broken in
78047326b4
since it stopped using the DefaultServeMux.

This approach will defer pprof requests to the DefaultServeMux, which
may or may not have pprof enabled (in Prometheus, it gets it included in
main.go). An alternative approach would be to duplicate the four lines in
https://golang.org/src/net/http/pprof/pprof.go#L62. When choosing that
approach though, we would not automatically gain any new endpoints added
by net/http/pprof or other /debug endpoints in the future.
pull/915/head
Julius Volz 2015-07-22 00:27:55 +02:00
parent d437fce299
commit c5c7f92960
1 changed files with 2 additions and 0 deletions

View File

@ -171,6 +171,8 @@ func New(st local.Storage, qe *promql.Engine, rm *rules.Manager, status *Prometh
router.Post("/-/quit", h.quit)
}
router.Get("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
return h
}