From 946819e16ecd370b5a43f004980daaf8c6b752b8 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 6 Oct 2020 21:42:56 +0200 Subject: [PATCH] cmd/prometheus: Issue a warning on 32 bit archs (#8012) * cmd/prometheus: Issue a warning on 32 bit archs Signed-off-by: Julien Pivotto --- cmd/prometheus/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 5c004d660..6766de13b 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -19,6 +19,7 @@ import ( "fmt" "io" "math" + "math/bits" "net" "net/http" _ "net/http/pprof" // Comment this line to disable pprof endpoint. @@ -344,6 +345,10 @@ func main() { klog.SetLogger(log.With(logger, "component", "k8s_client_runtime")) level.Info(logger).Log("msg", "Starting Prometheus", "version", version.Info()) + if bits.UintSize < 64 { + level.Warn(logger).Log("msg", "This Prometheus binary has not been compiled for a 64-bit architecture. Due to virtual memory constraints of 32-bit systems, it is highly recommended to switch to a 64-bit binary of Prometheus.", "GOARCH", runtime.GOARCH) + } + level.Info(logger).Log("build_context", version.BuildContext()) level.Info(logger).Log("host_details", prom_runtime.Uname()) level.Info(logger).Log("fd_limits", prom_runtime.FdLimits())