Merge pull request #171 from prometheus/julius-fix-debug

Register pprof /debug endpoints with custom HTTP mux.
pull/170/merge
juliusv 2013-04-22 04:33:09 -07:00
commit d65353fc1b
1 changed files with 8 additions and 1 deletions

View File

@ -25,7 +25,7 @@ import (
"html/template"
"log"
"net/http"
_ "net/http/pprof"
"net/http/pprof"
)
// Commandline flags.
@ -37,6 +37,13 @@ var (
func StartServing(appState *appstate.ApplicationState) {
gorest.RegisterService(api.NewMetricsService(appState))
// TODO(julius): This will need to be rewritten once the exp package provides
// the coarse mux behaviors via a wrapper function.
exp.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index))
exp.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
exp.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
exp.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
exp.Handle("/", &StatusHandler{appState: appState})
exp.HandleFunc("/graph", graphHandler)
exp.HandleFunc("/console", consoleHandler)