2021-05-11 22:59:05 +00:00
|
|
|
package httputil
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"net/http/pprof"
|
2024-10-30 13:42:09 +00:00
|
|
|
|
|
|
|
"github.com/felixge/fgprof"
|
2021-05-11 22:59:05 +00:00
|
|
|
)
|
|
|
|
|
2024-10-30 13:42:09 +00:00
|
|
|
func init() {
|
|
|
|
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
|
|
|
|
}
|
|
|
|
|
2021-05-11 22:59:05 +00:00
|
|
|
// initializes pprof package in order to
|
|
|
|
// register Prometheus handlers on http.DefaultServeMux.
|
|
|
|
var _ = pprof.Handler("")
|
|
|
|
|
|
|
|
// Handler returns http.Handler for the
|
|
|
|
// Prometheus metrics collector.
|
|
|
|
func Handler() http.Handler {
|
|
|
|
return http.DefaultServeMux
|
|
|
|
}
|