mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
feat: add pprof endpoints
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func handler(h http.Handler) echo.HandlerFunc {
|
||||||
|
return echo.WrapHandler(h)
|
||||||
|
}
|
||||||
|
|
||||||
func EchoErrorHandler() echo.MiddlewareFunc {
|
func EchoErrorHandler() echo.MiddlewareFunc {
|
||||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/jsiebens/ionscale/internal/service"
|
"github.com/jsiebens/ionscale/internal/service"
|
||||||
"github.com/jsiebens/ionscale/internal/templates"
|
"github.com/jsiebens/ionscale/internal/templates"
|
||||||
"github.com/labstack/echo-contrib/echoprometheus"
|
"github.com/labstack/echo-contrib/echoprometheus"
|
||||||
|
"github.com/labstack/echo-contrib/pprof"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/labstack/echo/v4/middleware"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
certmagicsql "github.com/travisjeffery/certmagic-sqlstorage"
|
certmagicsql "github.com/travisjeffery/certmagic-sqlstorage"
|
||||||
@@ -108,6 +109,7 @@ func Start(ctx context.Context, c *config.Config) error {
|
|||||||
|
|
||||||
metricsHandler := echo.New()
|
metricsHandler := echo.New()
|
||||||
metricsHandler.GET("/metrics", echoprometheus.NewHandler())
|
metricsHandler.GET("/metrics", echoprometheus.NewHandler())
|
||||||
|
pprof.Register(metricsHandler)
|
||||||
|
|
||||||
createPeerHandler := func(machinePublicKey key.MachinePublic) http.Handler {
|
createPeerHandler := func(machinePublicKey key.MachinePublic) http.Handler {
|
||||||
registrationHandlers := handlers.NewRegistrationHandlers(machinePublicKey, c, sessionManager, repository)
|
registrationHandlers := handlers.NewRegistrationHandlers(machinePublicKey, c, sessionManager, repository)
|
||||||
|
|||||||
Reference in New Issue
Block a user