diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-10-20 06:41:08 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-10-20 06:41:08 +0300 |
| commit | b679462fa687b375ccefd3c11fec3fd96b9b4d60 (patch) | |
| tree | 62539ed177a1dfcf92347737179ea1054401c9bd /cmd/dtailhealth | |
| parent | 5b56cb675fb3b7ad58c5de28760bc19f63a575bb (diff) | |
make pprof bind address configurable
Diffstat (limited to 'cmd/dtailhealth')
| -rw-r--r-- | cmd/dtailhealth/main.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/dtailhealth/main.go b/cmd/dtailhealth/main.go index ec97d3a..326c43a 100644 --- a/cmd/dtailhealth/main.go +++ b/cmd/dtailhealth/main.go @@ -3,7 +3,6 @@ package main import ( "context" "flag" - "fmt" "os" "sync" @@ -23,13 +22,13 @@ import ( func main() { var args config.Args var displayVersion bool - var pprof int + var pprof string flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.StringVar(&args.Logger, "logger", config.DefaultHealthCheckLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", "none", "Log level") flag.StringVar(&args.ServersStr, "server", "", "Remote server to connect") + flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") flag.Parse() if displayVersion { @@ -44,11 +43,9 @@ func main() { wg.Add(1) dlog.Start(ctx, &wg, source.HealthCheck) - if pprof > -1 { - // For debugging purposes only - pprofArgs := fmt.Sprintf("0.0.0.0:%d", pprof) - go http.ListenAndServe(pprofArgs, nil) - dlog.Client.Info("Started PProf", pprofArgs) + if pprof != "" { + go http.ListenAndServe(pprof, nil) + dlog.Client.Info("Started PProf", pprof) } healthClient, _ := clients.NewHealthClient(args) |
