add pprof handler
Some checks failed
build container / build-container (push) Failing after 22s
run go test / test (push) Failing after 19s

This commit is contained in:
2025-03-03 00:26:29 +08:00
parent 629c095bbe
commit f9ff71f62a
6 changed files with 59 additions and 13 deletions

17
cmd/proxy/debug.go Normal file
View File

@ -0,0 +1,17 @@
//go:build pprof
package main
import (
"flag"
"os"
)
func init() {
flag.BoolVar(&pprofEnabled, "pprof", true, "")
if v, ok := os.LookupEnv("SENTRY_DSN"); ok {
sentrydsn = v
}
flag.StringVar(&sentrydsn, "sentry", sentrydsn, "sentry dsn to report errors")
}