From 2d05f2e0c3f1533802a4e00d32928e2a09c1e107 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 30 Nov 2022 17:16:46 +0100 Subject: [PATCH] Log current value of GOMAXPROCS With `--runtime.gomaxprocs=0`, the GOMAXPROXS value will default to the number of logical CPUs. In this case, it is more useful to log the actual value than the value set by the user via the command-line. Signed-off-by: Simon Pasquier --- node_exporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_exporter.go b/node_exporter.go index 2f1f0c62..ac2ed880 100644 --- a/node_exporter.go +++ b/node_exporter.go @@ -183,7 +183,7 @@ func main() { level.Warn(logger).Log("msg", "Node Exporter is running as root user. This exporter is designed to run as unprivileged user, root is not required.") } runtime.GOMAXPROCS(*maxProcs) - level.Debug(logger).Log("msg", "Go MAXPROCS", "procs", *maxProcs) + level.Debug(logger).Log("msg", "Go MAXPROCS", "procs", runtime.GOMAXPROCS(0)) http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests, logger)) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {