diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 20cfaa853..c83a6dec3 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -22,6 +22,7 @@ import ( "os" "os/signal" "path/filepath" + "runtime" "strings" "syscall" "time" @@ -64,6 +65,11 @@ func init() { } func main() { + if os.Getenv("DEBUG") != "" { + runtime.SetBlockProfileRate(20) + runtime.SetMutexProfileFraction(20) + } + cfg := struct { printVersion bool configFile string