Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit d1ad7c1

Browse files
author
Jonathan Chauncey
committed
feat(pprof): Add pprof endpoint
We will now include a pprof endpoint located at http://0.0.0.0:8099/debug/pprof. This allows user to exec into the running pod and look at debug information like number of executing goroutines and memory profile.
1 parent 65ed719 commit d1ad7c1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

weblog/router.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
package weblog
22

33
import (
4+
"log"
5+
"net/http"
6+
7+
_ "net/http/pprof"
8+
49
"github.com/gorilla/mux"
510
)
611

712
func newRouter(rh *requestHandler) *mux.Router {
13+
14+
go func() {
15+
log.Println(http.ListenAndServe("0.0.0.0:8099", nil))
16+
}()
17+
818
r := mux.NewRouter()
919
r.HandleFunc("/healthz", rh.getHealthz).Methods("GET")
1020
r.HandleFunc("/healthz/", rh.getHealthz).Methods("GET")

0 commit comments

Comments
 (0)