diff --git a/go.mod b/go.mod index 6e303ea..c8aa358 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ go 1.23.0 require ( github.com/etherlabsio/healthcheck/v2 v2.0.0 github.com/getsentry/sentry-go v0.29.0 + github.com/gin-contrib/pprof v1.5.0 github.com/gin-gonic/gin v1.10.0 github.com/go-sql-driver/mysql v1.8.1 github.com/spf13/viper v1.19.0 diff --git a/go.sum b/go.sum index 8e7b858..47a3ae5 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= github.com/getsentry/sentry-go v0.29.0 h1:YtWluuCFg9OfcqnaujpY918N/AhCCwarIDWOYSBAjCA= github.com/getsentry/sentry-go v0.29.0/go.mod h1:jhPesDAL0Q0W2+2YEuVOvdWmVtdsr1+jtBrlDEVWwLY= +github.com/gin-contrib/pprof v1.5.0 h1:E/Oy7g+kNw94KfdCy3bZxQFtyDnAX2V7axRS7sNYVrU= +github.com/gin-contrib/pprof v1.5.0/go.mod h1:GqFL6LerKoCQ/RSWnkYczkTJ+tOAUVN/8sbnEtaqOKs= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= diff --git a/internal/cmd/serve.go b/internal/cmd/serve.go index 9ebbbde..5a065c9 100644 --- a/internal/cmd/serve.go +++ b/internal/cmd/serve.go @@ -11,6 +11,7 @@ import ( "github.com/etherlabsio/healthcheck/v2" "github.com/getsentry/sentry-go" sentrygin "github.com/getsentry/sentry-go/gin" + "github.com/gin-contrib/pprof" "github.com/gin-gonic/gin" "go.uber.org/multierr" @@ -53,6 +54,7 @@ func Serve() error { } r := gin.Default() + pprof.Register(r) r.Use(sentrygin.New(sentrygin.Options{Repanic: true})) r.Use(sentryLogging.ErrorMiddleware()) r.Use(http.ErrorMiddleware())