diff --git a/app/vmbackup/main.go b/app/vmbackup/main.go index 6c58f26f27..c158a9eeae 100644 --- a/app/vmbackup/main.go +++ b/app/vmbackup/main.go @@ -73,7 +73,6 @@ func main() { }() } - logger.Infof("starting http server for exporting metrics at http://%q/metrics", *httpListenAddr) go httpserver.Serve(*httpListenAddr, nil) srcFS, err := newSrcFS() diff --git a/app/vmrestore/main.go b/app/vmrestore/main.go index f1713d3510..1c74b3d89d 100644 --- a/app/vmrestore/main.go +++ b/app/vmrestore/main.go @@ -36,7 +36,6 @@ func main() { buildinfo.Init() logger.Init() - logger.Infof("starting http server for exporting metrics at http://%q/metrics", *httpListenAddr) go httpserver.Serve(*httpListenAddr, nil) srcFS, err := newSrcFS() diff --git a/docs/README.md b/docs/README.md index 501528b855..941410c988 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1217,7 +1217,8 @@ Consider setting the following command-line flags: * `-snapshotAuthKey` for protecting `/snapshot*` endpoints. See [how to work with snapshots](#how-to-work-with-snapshots). * `-forceMergeAuthKey` for protecting `/internal/force_merge` endpoint. See [force merge docs](#forced-merge). * `-search.resetCacheAuthKey` for protecting `/internal/resetRollupResultCache` endpoint. See [backfilling](#backfilling) for more details. -* `-configAuthKey` for pretecting `/config` endpoint, since it may contain sensitive information such as passwords. +* `-configAuthKey` for protecting `/config` endpoint, since it may contain sensitive information such as passwords. +- `-pprofAuthKey` for protecting `/debug/pprof/*` endpoints, which can be used for [profiling](#profiling). Explicitly set internal network interface for TCP and UDP ports for data ingestion with Graphite and OpenTSDB formats. For example, substitute `-graphiteListenAddr=:2003` with `-graphiteListenAddr=:2003`. diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index 9629f86774..30b85c6952 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -1221,7 +1221,8 @@ Consider setting the following command-line flags: * `-snapshotAuthKey` for protecting `/snapshot*` endpoints. See [how to work with snapshots](#how-to-work-with-snapshots). * `-forceMergeAuthKey` for protecting `/internal/force_merge` endpoint. See [force merge docs](#forced-merge). * `-search.resetCacheAuthKey` for protecting `/internal/resetRollupResultCache` endpoint. See [backfilling](#backfilling) for more details. -* `-configAuthKey` for pretecting `/config` endpoint, since it may contain sensitive information such as passwords. +* `-configAuthKey` for protecting `/config` endpoint, since it may contain sensitive information such as passwords. +- `-pprofAuthKey` for protecting `/debug/pprof/*` endpoints, which can be used for [profiling](#profiling). Explicitly set internal network interface for TCP and UDP ports for data ingestion with Graphite and OpenTSDB formats. For example, substitute `-graphiteListenAddr=:2003` with `-graphiteListenAddr=:2003`. diff --git a/lib/httpserver/httpserver.go b/lib/httpserver/httpserver.go index 1e37a3ead1..e136ca71b9 100644 --- a/lib/httpserver/httpserver.go +++ b/lib/httpserver/httpserver.go @@ -80,8 +80,12 @@ func Serve(addr string, rh RequestHandler) { if *tlsEnable { scheme = "https" } - logger.Infof("starting http server at %s://%s/", scheme, addr) - logger.Infof("pprof handlers are exposed at %s://%s/debug/pprof/", scheme, addr) + hostAddr := addr + if strings.HasPrefix(hostAddr, ":") { + hostAddr = "127.0.0.1" + hostAddr + } + logger.Infof("starting http server at %s://%s/", scheme, hostAddr) + logger.Infof("pprof handlers are exposed at %s://%s/debug/pprof/", scheme, hostAddr) lnTmp, err := netutil.NewTCPListener(scheme, addr) if err != nil { logger.Fatalf("cannot start http server at %s: %s", addr, err)