github.com/zhiqiangxu/util@v0.0.0-20230112053021-0a7aee056cd5/monitor/init.go (about)

     1  package monitor
     2  
     3  // this module registers metrics and pprof to http.DefaultServeMux
     4  
     5  import (
     6  	"net/http"
     7  	// enable pprof
     8  	_ "net/http/pprof"
     9  
    10  	"github.com/prometheus/client_golang/prometheus/promhttp"
    11  )
    12  
    13  func init() {
    14  	http.Handle("/metrics", promhttp.Handler())
    15  }