Skip to content

Commit

Permalink
fix: add debug router
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 12, 2024
1 parent 66b6fd4 commit d4b056f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"net"
"net/http"
"net/http/pprof"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -107,6 +108,11 @@ func New() *echo.Echo {
app.Use(recovery.New())

app.GET("/metrics", echo.WrapHandler(promhttp.Handler()))
app.GET("/debug/pprof/cmdline", echo.WrapHandler(http.HandlerFunc(pprof.Cmdline)))
app.GET("/debug/pprof/profile", echo.WrapHandler(http.HandlerFunc(pprof.Profile)))
app.GET("/debug/pprof/symbol", echo.WrapHandler(http.HandlerFunc(pprof.Symbol)))
app.GET("/debug/pprof/trace", echo.WrapHandler(http.HandlerFunc(pprof.Trace)))
app.GET("/debug/pprof/*", echo.WrapHandler(http.HandlerFunc(pprof.Index)))

addProfile(app)

Expand Down

0 comments on commit d4b056f

Please sign in to comment.